check-for-match
Advanced tools
Comparing version 0.1.0 to 0.2.0
'use strict'; | ||
module.exports = function (p, exp) { | ||
for (var i = 0; i < exp.length; i++) { | ||
if (p.match(exp[i])) { | ||
var s = p.match(exp[i]); | ||
p = String(s); | ||
module.exports = function (string, exp) { | ||
return new Promise(function(resolve, reject) { | ||
for (var i = 0; i < exp.length; i++) { | ||
if (!string) { | ||
reject('Input needed, "string" is: ' + undefined); | ||
} | ||
if (string.match(exp[i])) { | ||
var s = string.match(exp[i]); | ||
string = String(s); | ||
} | ||
} | ||
} | ||
return p; | ||
resolve(string); | ||
}); | ||
}; |
{ | ||
"name": "check-for-match", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "An 'String.match(regExp)' solution", | ||
@@ -5,0 +5,0 @@ "homepage": "", |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2932
15
0