extra-utilities
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -183,2 +183,10 @@ (function(global, factory) { | ||
var regExpFlags = { | ||
global: "g", | ||
multiline: "m", | ||
ignoreCase: "i", | ||
sticky: "y", | ||
unicode: "u" | ||
}; | ||
utilities.isValid = function(value) { | ||
@@ -1668,2 +1676,13 @@ return value !== undefined && value !== null; | ||
} | ||
else if(value instanceof RegExp) { | ||
var flags = ""; | ||
for(var flag in regExpFlags) { | ||
if(value[flag]) { | ||
flags += regExpFlags[flag] | ||
} | ||
} | ||
return new RegExp(value.source, flags); | ||
} | ||
else if(typeof Buffer !== "undefined" && value instanceof Buffer) { | ||
@@ -1670,0 +1689,0 @@ return new Buffer(value); |
{ | ||
"name": "extra-utilities", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "A collection of useful helper functions.", | ||
@@ -5,0 +5,0 @@ "main": "dist/extra-utilities.js", |
@@ -175,2 +175,10 @@ if(typeof require !== "undefined") { | ||
var regExpFlags = { | ||
global: "g", | ||
multiline: "m", | ||
ignoreCase: "i", | ||
sticky: "y", | ||
unicode: "u" | ||
}; | ||
utilities.isValid = function(value) { | ||
@@ -1660,2 +1668,13 @@ return value !== undefined && value !== null; | ||
} | ||
else if(value instanceof RegExp) { | ||
var flags = ""; | ||
for(var flag in regExpFlags) { | ||
if(value[flag]) { | ||
flags += regExpFlags[flag] | ||
} | ||
} | ||
return new RegExp(value.source, flags); | ||
} | ||
else if(typeof Buffer !== "undefined" && value instanceof Buffer) { | ||
@@ -1662,0 +1681,0 @@ return new Buffer(value); |
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
106606
3505