Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sms-length",
"author": "inkOfPixel srl",
"version": "0.2.0",
"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": [
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down