No type coercion
bhable opened this issue · 2 comments
bhable commented
Great job, I love the idea!
But it looses JS' type coercion capability. In concreto: Every method has to match the type of the primitive or of the preceding method.
jonrandy commented
This would be an issue with how someone chooses to use the library, rather than the library itself?
bhable commented
Today's change solves my issue.
Now I can write
`const log = Metho.add(
[Number.prototype, String.prototype, Boolean.prototype],
function() { console.log('>>>', this) },
);
42[log];
42[hex][log];`
Square brackets are JS' new pipe operator :-)