Comparing version 2.2.5 to 2.2.6
13
IsA.js
@@ -80,14 +80,17 @@ var boolTag = '[object Boolean]', | ||
}, | ||
isValidPath: function (object, path) { | ||
if ( !path ) return true | ||
walk: function (object, path, defaultValue) { | ||
if ( !path ) return defaultValue | ||
let oPath = path.split('.') | ||
let oPath = Array.isArray(path) ? path : path.split('.') | ||
if ( !object && oPath.length === 0 ) return true | ||
for ( let key of oPath ) { | ||
if ( !object || !object[key] ) return false | ||
if ( !object || !object[key] ) return defaultValue | ||
object = object[ key ] | ||
} | ||
return true | ||
return object || defaultValue | ||
}, | ||
isValidPath: function (object, path) { | ||
return !!module.exports.walk(object, path, null) | ||
}, | ||
parameterNames: function ( func ) { | ||
@@ -94,0 +97,0 @@ var fnStr = func.toString().replace(STRIP_COMMENTS, '') |
{ | ||
"name": "isa.js", | ||
"version": "2.2.5", | ||
"version": "2.2.6", | ||
"description": "Very minimal collection is isA functions. isObject, isArray, isDate...", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/imrefazekas/isa", |
@@ -29,1 +29,5 @@ ISA - dependency-free very minimal collection of IsA.. functions | ||
isArray, isObject, isError, isNumber, isDate, isFunction, isAsyncFunction, isBoolean, isString, isRegExp | ||
Extras: | ||
pick, walk, isValidPath |
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
12461
303
33