UNPKG

@antv/util

Version:

> AntV 底层依赖的工具库,不建议在自己业务中使用。

16 lines (14 loc) 324 B
import reduce from './reduce'; import { ObjectType } from './types'; export default <T>(obj: ObjectType<T>, keys: string[]): ObjectType<T> => { return reduce( obj, (r: ObjectType<T>, curr: T, key: string) => { if (!keys.includes(key)) { r[key] = curr; } return r; }, {}, ); };