@yuenu/utils-collection
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "@yuenu/utils-collection", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "utils collection", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -1,1 +0,20 @@ | ||
export * from './getMoneyNumbersFromString' | ||
function getMoneyNumbersFromString(str) { | ||
// make sure the input is a string | ||
if (typeof str !== 'string') { | ||
return ''; | ||
} | ||
// remove all non-digit characters from the string | ||
let digitsOnly = str.replace(/\D/g, ''); | ||
// if the first character is 0, remove it | ||
if (digitsOnly.charAt(0) === '0' && digitsOnly.length > 1) { | ||
digitsOnly = digitsOnly.slice(1); | ||
} | ||
return digitsOnly; | ||
} | ||
module.exports = { | ||
getMoneyNumbersFromString | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2209
51