finnfiddle / words-to-numbers

JS library to convert textual words to numbers with optional fuzzy text matching
MIT License
248 stars 57 forks source link

uses a plugin that breaks node #33

Open nitramreffehcs opened 3 years ago

nitramreffehcs commented 3 years ago

sadly words-to-numbers uses "clj-fuzzy" a module that attaches a new function, called "s" to the Date prototype

this explains some of the other issues here, and it makes this module unusable, it breaks modules like 'later' and any other module that attaches a property called "s" on a Date (also a bad idea, but that doesn't interfere with anyone else)

the offending code in clj-fuzzy

Date.prototype.s = function (a, b) { return b instanceof Date && this.valueOf() === b.valueOf() }