UNPKG

@tidyjs/tidy

Version:

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

13 lines (10 loc) 359 B
import { keysFromItems } from '../helpers/keysFromItems.js'; function startsWith(prefix, ignoreCase = true) { return (items) => { const regex = new RegExp(`^${prefix}`, ignoreCase ? "i" : void 0); const keys = keysFromItems(items); return keys.filter((d) => regex.test(d)); }; } export { startsWith }; //# sourceMappingURL=startsWith.js.map