UNPKG

@tidyjs/tidy

Version:

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

17 lines (12 loc) 461 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var keysFromItems = require('../helpers/keysFromItems.js'); function startsWith(prefix, ignoreCase = true) { return (items) => { const regex = new RegExp(`^${prefix}`, ignoreCase ? "i" : void 0); const keys = keysFromItems.keysFromItems(items); return keys.filter((d) => regex.test(d)); }; } exports.startsWith = startsWith; //# sourceMappingURL=startsWith.js.map