New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

isa.js

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isa.js - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

12

IsA.js

@@ -82,2 +82,14 @@ 'use strict'

},
isValidPath: function (object, path) {
if ( !path ) return true
let oPath = path.split('.')
if ( !object && oPath.length === 0 ) return true
for ( let key of oPath ) {
if ( !object || !object[key] ) return false
object = object[ key ]
}
return true
},
parameterNames: function ( func ) {

@@ -84,0 +96,0 @@ var fnStr = func.toString().replace(STRIP_COMMENTS, '')

6

package.json
{
"name": "isa.js",
"version": "2.1.1",
"version": "2.2.0",
"description": "Very minimal collection is isA functions. isObject, isArray, isDate...",

@@ -26,5 +26,5 @@ "homepage": "https://github.com/imrefazekas/isa",

"gulp": "^3.9.1",
"gulp-eslint": "^4.0.0",
"gulp-eslint": "^4.0.1",
"gulp-load-plugins": "^1.5.0",
"gulp-mocha": "^4.3.1",
"gulp-mocha": "^5.0.0",
"gulp-rename": "^1.2.2",

@@ -31,0 +31,0 @@ "gulp-uglify": "^3.0.0"

@@ -39,2 +39,14 @@ 'use strict'

})
it('Path check', function (done) {
let p = { data: 'hello', content: { name: 'Peter' } }
expect( _.isValidPath( p, 'data' ) ).to.be.true
expect( _.isValidPath( p, 'name' ) ).to.be.false
expect( _.isValidPath( p, '' ) ).to.be.true
expect( _.isValidPath( p, null ) ).to.be.true
expect( _.isValidPath( null, '' ) ).to.be.true
expect( _.isValidPath( null, 'name' ) ).to.be.false
expect( _.isValidPath( p, 'content' ) ).to.be.true
expect( _.isValidPath( p, 'content.name' ) ).to.be.true
done()
})
})

@@ -41,0 +53,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc