js-must icon indicating copy to clipboard operation
js-must copied to clipboard

Provide a non-strict property check

Open smlgbl opened this issue 10 years ago • 4 comments

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.

smlgbl avatar Jul 08 '14 13:07 smlgbl

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?

moll avatar Sep 22 '15 14:09 moll

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.

smlgbl avatar Sep 23 '15 08:09 smlgbl

Too old now. Cleanup.

smlgbl avatar Aug 14 '20 12:08 smlgbl

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:

moll avatar Aug 14 '20 12:08 moll