Comparing version 0.4.0 to 0.4.1
@@ -8,2 +8,3 @@ declare function containsNum(num: string | number): boolean; | ||
declare function convertToHex(num: string | number): string | null; | ||
declare function isPhoneNumber(str: string | number): boolean; | ||
declare const numbers: { | ||
@@ -16,4 +17,5 @@ containsDecimal: typeof containsDecimal; | ||
fraction: typeof fraction; | ||
isPhoneNumber: typeof isPhoneNumber; | ||
whole: typeof whole; | ||
}; | ||
export { numbers }; |
@@ -47,2 +47,9 @@ "use strict"; | ||
} | ||
function isPhoneNumber(str) { | ||
if (typeof str !== 'string' && typeof str !== 'number') { | ||
return false; | ||
} | ||
const test = typeof str === 'number' ? str.toString() : str; | ||
return !!test.match(/^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im); | ||
} | ||
const numbers = { | ||
@@ -55,4 +62,5 @@ containsDecimal, | ||
fraction, | ||
isPhoneNumber, | ||
whole | ||
}; | ||
exports.numbers = numbers; |
{ | ||
"name": "stringman", | ||
"version": "0.4.0", | ||
"description": "Stringman does a lot of the slightly unusual string manipulation and regex operations for you.", | ||
"version": "0.4.1", | ||
"description": "Stringman does a lot of string manipulation and regex operations for you.", | ||
"main": "lib/index.js", | ||
@@ -21,3 +21,3 @@ "types": "lib/index.d.ts", | ||
"lint": "tslint -p tsconfig.json", | ||
"docs": "rimraf ./docs && typedoc --out docs/ src/ && touch ./docs/.nojekyll" | ||
"docs": "rimraf ./docs && typedoc --exclude src/index.ts --name Stringman --out docs/ src/ && touch ./docs/.nojekyll" | ||
}, | ||
@@ -27,6 +27,12 @@ "keywords": [ | ||
"regex", | ||
"string", | ||
"manipulation" | ||
"string manipulation", | ||
"manipulation", | ||
"colors", | ||
"numbers" | ||
], | ||
"author": "Joey Gauthier", | ||
"author": { | ||
"name": "Joey Gauthier", | ||
"email": "joey@joeyg.me", | ||
"url": "https://joeyg.me" | ||
}, | ||
"license": "ISC", | ||
@@ -42,5 +48,4 @@ "devDependencies": { | ||
"typedoc": "^0.15.0", | ||
"typescript": "^3.6.3", | ||
"uglify-es": "^3.3.9" | ||
"typescript": "^3.6.3" | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
14525
9
375
0