From d54c514c3766bf769b964d599863b775cab8b438 Mon Sep 17 00:00:00 2001 From: Federico Badini Date: Fri, 16 May 2025 12:14:25 +0200 Subject: [PATCH 1/3] feat: expose charset regex --- package.json | 2 +- src/index.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 75c5c3f..6daf0fc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "sms-length", "author": "inkOfPixel srl", - "version": "0.2.0", + "version": "0.2.1", "license": "MIT", "description": "A simple utility function to understand how many sms will be required to send a text message via SMS. Largely inspired by sms-counter.", "keywords": [ diff --git a/src/index.ts b/src/index.ts index 84128ad..59899ba 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,10 @@ export type Encoding = "GSM_7BIT" | "GSM_7BIT_EXT" | "UTF16"; -const GSM_7BIT_REGEXP = +export const GSM_7BIT_REGEXP = /^[@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞÆæßÉ !"#¤%&'()*+,\-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà]*$/; -const GSM_7BIT_EXT_REGEXP = +export const GSM_7BIT_EXT_REGEXP = /^[@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞÆæßÉ !"#¤%&'()*+,\-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà^{}\\[~\]|€]*$/; -const GSM_7BIT_EXT_CHAR_REGEXP = /[\^{}\\[~\]|€]/g; +export const GSM_7BIT_EXT_CHAR_REGEXP = /[\^{}\\[~\]|€]/g; const messageLength: { [key in Encoding]: number } = { GSM_7BIT: 160, From 031f99d1c327d8b6e82584aa82f156f6112f4413 Mon Sep 17 00:00:00 2001 From: Federico Badini Date: Fri, 16 May 2025 12:19:04 +0200 Subject: [PATCH 2/3] chore: update runners config --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2fd1b43..c86c714 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node: ["10.x", "12.x", "14.x", "16.x", "18.x"] + node: ["16.x", "18.x", "20.x", "22.x"] os: [ubuntu-latest, windows-latest, macOS-latest] steps: From 9628ba82b26f5a3b3d11a711ec9894804f398b00 Mon Sep 17 00:00:00 2001 From: Federico Badini Date: Fri, 16 May 2025 12:25:45 +0200 Subject: [PATCH 3/3] chore: version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6daf0fc..be589bd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "sms-length", "author": "inkOfPixel srl", - "version": "0.2.1", + "version": "0.2.2", "license": "MIT", "description": "A simple utility function to understand how many sms will be required to send a text message via SMS. Largely inspired by sms-counter.", "keywords": [