UNPKG

@tidyjs/tidy

Version:

Tidy up your data with JavaScript, inspired by dplyr and the tidyverse

17 lines (14 loc) 487 B
import { keysFromItems } from '../helpers/keysFromItems.js'; function numRange(prefix, range, width) { return (items) => { const keys = keysFromItems(items); const matchKeys = []; for (let i = range[0]; i <= range[1]; ++i) { const num = width == null ? i : new String("00000000" + i).slice(-width); matchKeys.push(`${prefix}${num}`); } return keys.filter((d) => matchKeys.includes(d)); }; } export { numRange }; //# sourceMappingURL=numRange.js.map