UNPKG

yargs

Version:

yargs the modern, pirate-themed, successor to optimist.

11 lines (10 loc) 299 B
import { objectKeys } from '../typings/common-types.js'; export function objFilter(original = {}, filter = () => true) { const obj = {}; objectKeys(original).forEach(key => { if (filter(key, original[key])) { obj[key] = original[key]; } }); return obj; }