{"version":3,"file":"index.mjs","sources":[""],"sourcesContent":["export type TGetObjWithOmittedPropsArgs = Parameters<typeof getObjWithOmittedProps>;\n\nexport type TGetObjWithOmittedPropsReturn = ReturnType<typeof getObjWithOmittedProps>;\n\n/**\n * Creates an object without selected own properties.\n * @template T,TKey\n * @param {T} obj Source object\n * @param {TKey[]} keys Keys to omit\n * @returns {Omit<T, TKey>} Remaining properties\n * @throws {TypeError} getObjWithOmittedProps: obj must be a plain object\n * @throws {TypeError} getObjWithOmittedProps: keys must be an array\n * @example\n * getObjWithOmittedProps({ id: 1, password: \"secret\" }, [ \"password\" ]); // { id: 1 }\n * @example\n * // Remove internal fields before sending a public API response\n * const publicUser = getObjWithOmittedProps(user, [ \"passwordHash\", \"internalNotes\" ]);\n */\nexport const getObjWithOmittedProps = <T extends object, TKey extends keyof T>(\n  obj: T,\n  keys: readonly TKey[]\n): Omit<T, TKey> => {\n  if (!obj || typeof obj !== \"object\" || Array.isArray(obj)) {\n    throw new TypeError(\"getObjWithOmittedProps: obj must be a plain object\");\n  }\n  if (!Array.isArray(keys)) {\n    throw new TypeError(\"getObjWithOmittedProps: keys must be an array\");\n  }\n\n  const omitted = new Set<PropertyKey>(keys);\n  const result = {} as Omit<T, TKey>;\n  Reflect.ownKeys(obj).forEach((key) => {\n    if (!omitted.has(key)) {\n      (result as Record<PropertyKey, unknown>)[key] = (obj as Record<PropertyKey, unknown>)[key];\n    }\n  });\n  return result;\n};\n"],"names":["getObjWithOmittedProps","obj","keys","Array","isArray","TypeError","omitted","Set","result","Reflect","ownKeys","forEach","key","has"],"mappings":"MAkBaA,uBAAyB,CACpCC,IACAC,QAEA,IAAKD,YAAcA,MAAQ,UAAYE,MAAMC,QAAQH,KACnD,MAAM,IAAII,UAAU,sDAEtB,IAAKF,MAAMC,QAAQF,MACjB,MAAM,IAAIG,UAAU,iDAGtB,MAAMC,QAAU,IAAIC,IAAiBL,MACrC,MAAMM,OAAS,CAAA,EACfC,QAAQC,QAAQT,KAAKU,QAASC,MAC5B,IAAKN,QAAQO,IAAID,KACdJ,OAAwCI,KAAQX,IAAqCW,OAG1F,OAAOJ"}