js-must
js-must copied to clipboard
Provide a non-strict property check
Sometimes I want to compare properties in a non-strict way, but would like to keep the notation. Besides, I'd like to see the actual value of the property right away, hence the change in output for an AssertionError.
Hey, Samuel! Thanks for the PR! I think I set my time machine in the wrong direction and missed one year. :D Seems this is a related to https://github.com/moll/js-must/issues/21. One idea I've had was to shorten the names of strict functions to have them use the eql
logic internally. property
would be prop
, include
as incl
et. al. On the negative side, you can't really tell how property
and prop
differ by their name. Boolean flags happen to have the same problem.
What's your stance these days?
Hi Andri,
in general I try to avoid naming discussions, but I like your idea with the shorter names as in === vs ==. To clarify for people not into the brevity thing, just alias them with strictEqual vs. nonStrictEqual. In my opinion they can and should all be recursive.
Too old now. Cleanup.
Hey! I think your contribution is still worth looking at and I expect to do so. Thank you again! I'll keep this open, if you don't mind, as a reminder to do so when I eventually stop procrastinating. :innocent: