dry-underscore
Advanced tools
Comparing version 0.17.6 to 0.17.7
@@ -945,2 +945,3 @@ "use strict"; | ||
if(n === ""){ return(null); } | ||
if(rnd === true){ return(_.n(_.numbers(n))); } | ||
@@ -1003,2 +1004,3 @@ n = n - 0; | ||
_.numbers = function(str_or_a){ | ||
if(_.isNumber(str_or_a)){ return("" + str_or_a); } | ||
var numbers = _.filter(str_or_a, function(char){ return(_.to_number(char) !== null); }); | ||
@@ -1005,0 +1007,0 @@ if(_.is_string(str_or_a) || str_or_a === undefined){ |
@@ -276,2 +276,9 @@ "use strict"; | ||
eq(f("a1b2c3"), null); | ||
eq(f("1b2c3", true), 123); | ||
eq(f("a1b2c3", true), 123); | ||
eq(f("230px", true), 230); | ||
eq(f("asdf", true), null); | ||
eq(f("", true), null); | ||
eq(f(null, true), null); | ||
eq(f(0, true), 0); | ||
} | ||
@@ -290,2 +297,4 @@ | ||
eq(_.numbers(""), "") | ||
eq(_.numbers(123), "123") | ||
eq(_.numbers(0), "0") | ||
eq(_.numbers(), "") | ||
@@ -292,0 +301,0 @@ eq(_.numbers([]), []) |
{ | ||
"name": "dry-underscore", | ||
"version": "0.17.6", | ||
"version": "0.17.7", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "deep-diff": { |
{ | ||
"name": "dry-underscore", | ||
"version": "0.17.6", | ||
"version": "0.17.7", | ||
"main": "./lib/index.js", | ||
@@ -5,0 +5,0 @@ "description": "The DRY Undescore Library", |
Sorry, the diff of this file is too big to display
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
1820951
20553