Releases: pocketrocket/floatify
Releases · pocketrocket/floatify
v2.0.0 — modern ESM-only rewrite
First major in years: a from-scratch modernization of floatify with zero runtime dependencies.
⚠️ Breaking changes
- ESM-only.
floatifyis now a native ES module (export default). Useimport floatify from "floatify";require()is no longer supported (CJS consumers on Node ≥ 22.12 can userequire(esm)). - Node ≥ 18 required.
What's changed
- Rewritten in modern ES6+ (no Babel — Node runs it natively). The parsing algorithm is unchanged; all 281 test assertions pass.
- Test suite migrated to the built-in
node:testrunner —mocha+c8removed, which also clears theserialize-javascript(RCE) anddiff(DoS) advisories at the root.npm audit→ 0 vulnerabilities. - eslint flat config; dropped legacy Babel/airbnb-es5/Travis/Scrutinizer setup.
- Published tarball scoped to
src/only.
Usage
import floatify from "floatify";
floatify("123.242,5346556"); //=> 123242.5346556
floatify("123.123", true); //=> 123.123 (prefer decimal separator)