UNPKG

@chakra-ui/object-utils

Version:

A Quick description of the component

17 lines (15 loc) 292 B
// src/split.ts function split(object, keys) { const picked = {}; const omitted = {}; for (const [key, value] of Object.entries(object)) { if (keys.includes(key)) picked[key] = value; else omitted[key] = value; } return [picked, omitted]; } export { split };