tapjs / tmatch

This module exists to facilitate the t.match() method in node-tap (http://npm.im/tap)
22 stars 9 forks source link

Add matchStrict to avoid type coercion #16

Open andrei-cocorean opened 7 years ago

andrei-cocorean commented 7 years ago

Hi, what do you think about adding a matchStrict function that uses strict equality for primitive types? e.g.

matchStrict({ x: 3 }, { x: '3' })  ===  false
isaacs commented 6 years ago

I'd be fine with that. Patch welcome. You can look at https://github.com/tapjs/tsame to see how it's strict/loose behavior is implemented.