jonrandy/metho

No type coercion

bhable opened this issue · 2 comments

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.

This would be an issue with how someone chooses to use the library, rather than the library itself?

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 :-)