Comments (1)
Giving this some more thought, I now think the most intuitive and flexible behavior would be to pass the result
of JSON.parse
to match(result, arg)
where arg
is the argument passed to match.json(arg)
. It could default to match.any
. This would mean:
match.json()
succeeds on anything that is parseable JSON.match.json({ key: 'value' })
succeeds when parsing the given string to an object that haskey
with'value'
(and any other keys).match.json(true)
succeeds for the stringtrue
.match.json(42)
succeeds for the string42
.match.json('something')
succeeds for any string that contains 'something'.match.json(function (result) { /* ... */ })
would match if the given function returnstrue
.
from samsam.
Related Issues (20)
- Match.js improve error message to describe what is going on
- Match.js to support checking for symbol HOT 3
- Circular dependency HOT 2
- Dependency was DELETED !! COME ON !! PLZ HELP HOT 1
- Create .d.ts from JSDoc
- deepEqual returns true for different promise instances HOT 1
- Infinite recursion on circular object when using sinon.match({})
- Error in headless Chromium HOT 1
- Add Sauce Labs test suite HOT 1
- Fix failing IE11 tests HOT 3
- Failling builds for #44 HOT 2
- Document createMatcher and match.* APIs HOT 2
- Deep equality matching broken on arrays HOT 3
- Version of lodash used is out of date HOT 8
- using deepEqual on Maps always returns true HOT 1
- deepEqual throws an exception while comparing two jQuery objects on IE-11 HOT 2
- Update version of lodash to address high severity vulnerability HOT 2
- Lodash vulnerability HOT 1
- isArgument invalid structure causing low test coverage HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from samsam.