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

checkv

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

checkv - npm Package Compare versions

Comparing version 0.0.2-alpha to 0.0.3-alpha

9

lib/Check.js

@@ -33,5 +33,7 @@ 'use strict'

for (const rule in rules) {
if (!validate.number[rule] &&
if (
!validate.number[rule] &&
!validate.object[rule] &&
!validate.function[rule]) {
!validate.function[rule]
) {
return __unknownRule(value, rule)

@@ -58,2 +60,5 @@ }

break
case 'isExactly':
_match = validate.object[rule](value, _compare)
break
case 'hasProperties':

@@ -60,0 +65,0 @@ _match = validate.object[rule](value, _compare)

@@ -13,4 +13,4 @@ 'use strict'

},
isEqual: function (value, than) {
return number.isNumber(value) && value === than
isEqual: function (value, to) {
return number.isNumber(value) && value === to
},

@@ -17,0 +17,0 @@ isGreater: function (value, than) {

@@ -25,2 +25,31 @@ 'use strict'

return true
},
/**
* @todo instance cases: Date, Regexp ...
*/
isExactly: function (value, to) {
if (typeof to !== typeof value) {
return false
}
if (typeof to === 'object') {
if (to.constructor.name !== value.constructor.name) {
return false
}
if (to instanceof Array) {
for (let i = 0; i < to.length; i++) {
if (!object.isExactly(value[i], to[i])) {
return false
}
}
return true
} else {
log.warning('check', 'object.isExactly, unknown instance', to.constructor.name)
return false
}
}
// primitives
return value === to
}

@@ -27,0 +56,0 @@ }

{
"name": "checkv",
"version": "0.0.2-alpha",
"version": "0.0.3-alpha",
"description": "validator checker",

@@ -5,0 +5,0 @@ "main": "main.js",

# checkv
! idiomatic
---

@@ -4,0 +6,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