lodash-match-pattern
lodash-match-pattern copied to clipboard
Deep JSON pattern matching library
If you try doing something like... ``` const matcher = chaiMatchPattern.getLodashModule(); ``` ...you'll quickly run into trouble as behind the scenes, `lodash-match-pattern` or one of its depedencies is looking for...
https://tonicdev.uservoice.com/knowledgebase/articles/765846-how-do-i-customize-the-example-for-my-npm-package
Error: {connection: 'close'} didn't match target {connection: undefined} If possible this should show a line number where the error occurred.
using ES6 destructuring syntax ``` javascript {isString} = matchPattern.getLodashModule() // Example usage: var testValue = {a: 1, b: 'abc'} var failResult = matchPattern(testValue, {a: isString, b: 'abc'}) ```