Commit activity
Last 12 weeks · 0 commits
Community health
2 of 6 standards met
Recent PRs & issues
Bug Report Description returns values in scientific notation for very large numbers, but cannot handle scientific notation — returning . This breaks the roundtrip contract between the two functions. Steps to Reproduce ```js import { ms } from 'ms'; const out = ms(Number.MAX_VALUE); console.log(out); // "5.696545792019405e+297y" console.log(ms(out)); // NaN — cannot parse its own output Expected Behavior Either: format() should not produce scientific notation output, OR parse() should handle scientific notation input Actual Behavior format() outputs 5.696545792019405e+297y parse() returns NaN for that same string Environment ms version: 4.0.0 Node.js on Android/Termux
Fixes #273. The recent TypeScript rewrite in \ 4.0.0\ introduced a significant performance regression (>40% slower) during parsing, which was tracked down to the use of named capture groups (\?\ and \?\). Executing Regex with named capture groups incurs substantial overhead in V8 compared to standard positional capture groups. By replacing the named capture groups with simple positional groups, we restore the \ms\ parsing performance back to its pre-\ 4.0.0\ baseline while keeping 100% of the TypeScript safety and logic. All tests still pass!
Repository: vercel/ms. Description: Tiny millisecond conversion utility Stars: 5559, Forks: 342. Primary language: TypeScript. Languages: TypeScript (100%). License: MIT. Homepage: https://npmjs.com/ms Topics: conversion, milliseconds, utility. Latest release: 2.1.3 (5y ago). Open PRs: 21, open issues: 19. Last activity: 5mo ago. Community health: 62%. Top contributors: leo, rauchg, dimitropoulos, tj, styfle, greenkeeper[bot], Swatinem, mrmckeb, leerob, greenkeeperio-bot and others.