dry-underscore
Advanced tools
Comparing version 0.19.1 to 0.20.0
@@ -509,2 +509,4 @@ "use strict"; | ||
_.basic_type.types = ["undefined", "null", "boolean", "array", "string", "number", "object"]; | ||
_.dryType = _.dry_type = function(o){ | ||
@@ -515,3 +517,3 @@ var t = _.basic_type(o); | ||
if(_.contains(["undefined", "null", "boolean", "array", "string", "number", "object"], t)){ | ||
if(_.contains(_.basic_type.types, t)){ | ||
return("object"); | ||
@@ -545,3 +547,4 @@ }else{ | ||
_.type_match = function(o, types, map_types){ | ||
var type = _.dry_type(o); | ||
var dry_type = _.dry_type(o); | ||
var basic_type = _.basic_type(o); | ||
@@ -554,3 +557,5 @@ if(arguments.length !== 3 || !_.isArray(types) || !map_types){ | ||
if(test_type === "*"){ return(true); } | ||
return(type === test_type); | ||
if(_.contains(_.basic_type.types, test_type) && test_type === basic_type){ | ||
return(true); | ||
}else{ return(dry_type === test_type); } | ||
}) !== undefined); | ||
@@ -557,0 +562,0 @@ }; |
@@ -1123,3 +1123,9 @@ "use strict"; | ||
eq(true, f(t, 't')); | ||
eq(true, f(x, 'x')); | ||
eq(true, f(x, 'object')); | ||
eq(true, f(x, 'object', 't')); | ||
eq(true, f(x, 't', 'object')); | ||
eq(true, f(x, ['t', 'object'], true)); | ||
eq(false, f(null, 'x')); | ||
@@ -1126,0 +1132,0 @@ eq(true, f(null, "null", 'x')); |
{ | ||
"name": "dry-underscore", | ||
"version": "0.19.1", | ||
"version": "0.20.0", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "deep-diff": { |
{ | ||
"name": "dry-underscore", | ||
"version": "0.19.1", | ||
"version": "0.20.0", | ||
"main": "./index/node.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
1920335
23218