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

data-matching

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-matching - npm Package Compare versions

Comparing version 1.26.0 to 1.27.0

test/gen_gen_matcher.test.js

6

package.json
{
"name": "data-matching",
"version": "1.26.0",
"version": "1.27.0",
"description": "Matches a data object against a reference value Edit",

@@ -34,4 +34,6 @@ "main": "src/index.js",

"devDependencies": {
"jest": "^27.4.3"
"jest": "^27.4.3",
"jsxpath": "^1.0.0-alpha.5",
"xml2json": "^0.12.0"
}
}

@@ -382,3 +382,29 @@ const _ = require('lodash')

var gen_gen_matcher = (parser, extractor, name) => {
return (expected) => {
var expected2 = matchify_strings(expected)
var f = (s, dict, throw_matching_error, path) => {
console.log("s:", s)
var received = parser(s)
console.log("received:", received)
return _.every(expected2, (val, key) => {
console.log("key:", key)
var item = extractor(received, key)
if(val == absent && item) {
if(throw_matching_error) {
throw Error(`key ${path}.${key} expected to be absent`)
}
return false
}
var full_match = false
return _match(val, item, dict, full_match , throw_matching_error, `${path}.${key}`)
})
}
f.__original_data__ = expected
f.__name__ = name
return f
}
}
module.exports = {

@@ -425,2 +451,4 @@ absent: absent,

_: anything,
gen_gen_matcher: gen_gen_matcher,
}
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