
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
object-match-statement
Advanced tools
Generates if one-liner, that returns true, if left object is subset of right object.
var Matcher = require('object-match-statement');
console.log(Matcher.build('obj', { a: 1, b: 1})); // -> 'obj.a === 1 && obj.b === 1'
Returns compiled function, that acceps object and returns Boolean, indicates, that passed object is matching compiled pattern.
Returns one-line if for comparsion other objects agains object param. Prefix used to identify compared object inside generated if.
Returns escaped property accessor. For example for valid will be returned .valid, but for -invalid will be returned ["-invalid"].
object-match-statement is using if for patterns, since inlining is not an option (we need to construct comparing statement by object fields and values).
simple object
164,427,234 op/s » inline#simple_match
101,336,062 op/s » inline#simple_mismatch
100,053,487 op/s » if#simple_match
75,304,293 op/s » if#simple_mismatch
87,757,658 op/s » swtch#simple_match
68,066,432 op/s » swtch#simple_mismatch
89,974,169 op/s » recursive#simple_match
22,123,933 op/s » recursive#simple_mismatch
complex object
123,443,614 op/s » inline#complex_match
123,150,712 op/s » inline#complex_mismatch
87,888,269 op/s » oms#complex_match
82,031,672 op/s » oms#complex_mismatch
71,166,844 op/s » swtch#complex_match
69,140,028 op/s » swtch#complex_mismatch
79,993,904 op/s » recursive#complex_match
21,916,098 op/s » recursive#complex_mismatch
MIT (c) Vsevolod Strukchinsky
FAQs
Builds string, that contains compare statement of two objects
We found that object-match-statement demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.