Skip to main content
Module

x/denofun/omit.ts

Small utility library containing functions, monads and other fun stuff.
Latest
File
/** * **omit** returns a copy of an object but without specified keys * @param keys keys to be omitted * @param object object to be copied * @returns an object without specified keys */export default function omit(keys: string[], object: object): object { let target = {};
for (let i in object) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(object, i)) continue;
target[i] = object[i]; }
return target;}