awesome-phonenumber
Advanced tools
Comparing version
@@ -25,10 +25,3 @@ const exportedName = 'PhoneNumber$$module$src$index'; | ||
{ | ||
const ret = module.exports( ...args ).toJSON( ); | ||
if ( !ret.valid && !ret.possible ) | ||
{ | ||
ret.possible = false; | ||
if ( !ret.possibility ) | ||
ret.possibility = 'invalid'; | ||
} | ||
return ret; | ||
return module.exports.parse( ...args ); | ||
} | ||
@@ -35,0 +28,0 @@ catch ( error ) |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "7.2.0", | ||
"version": "7.3.0", | ||
"author": "Gustaf Räntilä <g.rantila@gmail.com>", | ||
@@ -34,6 +34,6 @@ "repository": { | ||
"test": "yarn test:compile && NODE_OPTIONS=--experimental-vm-modules jest", | ||
"test-dist-webpack": "cd webpack && yarn build && yarn test", | ||
"test-dist-esm-test": "cd esm-test && yarn build && yarn test", | ||
"test-dist-cjs-test": "cd cjs-test && yarn build && yarn test", | ||
"test-dist": "yarn test-dist-webpack && yarn test-dist-esm-test && yarn test-dist-cjs-test", | ||
"test-dist-webpack": "yarn --cwd webpack build-test", | ||
"test-dist-esm": "yarn --cwd esm-test build-test", | ||
"test-dist-cjs": "yarn --cwd cjs-test build-test", | ||
"test-dist": "yarn test-dist-webpack && yarn test-dist-esm && yarn test-dist-cjs", | ||
"cz": "git-cz", | ||
@@ -68,8 +68,8 @@ "semantic-release": "semantic-release" | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.25.4", | ||
"@babel/preset-typescript": "^7.24.7", | ||
"@rollup/plugin-commonjs": "^28.0.0", | ||
"@types/jest": "^29.5.13", | ||
"@babel/preset-env": "^7.26.9", | ||
"@babel/preset-typescript": "^7.26.0", | ||
"@rollup/plugin-commonjs": "^28.0.2", | ||
"@types/jest": "^29.5.14", | ||
"@types/mkdirp": "^2.0.0", | ||
"@types/node": "^22.7.4", | ||
"@types/node": "^22.13.4", | ||
"commitizen": "^4.3.1", | ||
@@ -85,6 +85,6 @@ "cz-conventional-changelog": "^3.3.0", | ||
"rmfr": "^2.0.0", | ||
"rollup": "4.23.0", | ||
"rollup": "4.34.8", | ||
"ts-jest-resolver": "^2.0.1", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.6.2" | ||
"typescript": "^5.7.3" | ||
}, | ||
@@ -96,3 +96,3 @@ "config": { | ||
}, | ||
"packageManager": "yarn@3.2.4" | ||
"packageManager": "yarn@4.5.0" | ||
} |
@@ -16,3 +16,3 @@ [![npm version][npm-image]][npm-url] | ||
Uses libphonenumber v8.13.47 | ||
Uses libphonenumber v8.13.55 | ||
@@ -53,13 +53,16 @@ | ||
Action | awesome-phonenumber<br/>2.56.0<br/>(lib 8.12.29) | google-libphonenumber<br/>3.2.22<br/>(lib 8.12.27) | libphonenumber-js<br/>1.9.23<br/>(lib -) | ||
Action | awesome-phonenumber<br/>7.2.0<br/>(lib 8.13.47) | google-libphonenumber<br/>3.2.38<br/>(lib 8.13.42) | libphonenumber-js<br/>1.11.9<br/>(lib -) | ||
------------------------- | ------------------- | --------------------- | ---------------- | ||
Load library first time | 11.0 ms ✅ | 29.67 ms | 32.87 ms | ||
Parse first phone number | 4.3 ms | 4.01 ms | 3.43 ms ✅ | ||
**⇒ Load + parse first number** | 15.3 ms ✅ | 33.68 ms | 36.3 ms | ||
Parse second phone number | 0.78 ms ✅ | 0.97 ms | 0.92 ms | ||
Increased memory usage | 5.12 M ✅ | 9.99 M | 5.86 M | ||
node_modules size | 296 K ✅ | 600 K | 7.6 M | ||
node_modules files | 8 | 7 ✅ | 653 | ||
Load library first time | 7.82 ms ✅ | 14.28 ms | 14.53 ms | ||
Parse first phone number | 2.00 ms | 1.86 ms | 1.65 ms ✅ | ||
**⇒ Load + parse first number** | 9.82 ms ✅ | 16.14 ms | 16.18 ms | ||
Format again | 0.09 ms ✅ | 0.22 ms | 0.13 ms | ||
Parse again | 0.39 ms ✅ | 0.51 ms | 0.43 ms | ||
Increased memory usage | 9.77 M ✅ | 12.71 M | 11.25 M | ||
node_modules size | 720 K | * 604 K ✅ | 9.9 M | ||
node_modules files | 9 | * 7 ✅ | 787 | ||
\* NOTE: google-libphonenumber only ships CJS, while awesome-phonenumber and libphonenumber-js ships _both_ CJS and ESM | ||
## Basic usage | ||
@@ -66,0 +69,0 @@ ```ts |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
726902
0.53%413
0.73%