lodash-omitdeep 1.5.2 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"omitDeep.cjs","sources":["../../../src/omitDeep/omitDeep.ts"],"sourcesContent":["import type { Many, PartialObject, PropertyName } from 'lodash';\n\nimport { isNil, isPlainObject, omit } from 'lodash';\n\nexport const needOmit = (value: any) =>\n !isNil(value) && (isPlainObject(value) || Array.isArray(value));\n\ninterface OmitDeep {\n <T extends object, K extends PropertyName[]>(\n object: T | null | undefined,\n ...paths: K\n ): Pick<T, Exclude<keyof T, K[number]>>;\n <T extends object, K extends keyof T>(\n object: T | null | undefined,\n ...paths: Many<K>[]\n ): Omit<T, K>;\n <T extends object>(\n object: T | null | undefined,\n ...paths: Many<PropertyName>[]\n ): PartialObject<T>;\n}\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable properties of `object` that are not omitted.\n *\n * @category Function\n * @param object The source object.\n * @param [paths] The property names to omit, specified\n * individually or in arrays.\n * @returns Returns the new object.\n * @example\n *\n * const object = { 'a': 1, 'b': 2, 'c': { 'a': 1, 'b': 2 } };\n *\n * omitDeep(object, ['b', 'a']);\n * // => { 'c': {} }\n */\nexport const omitDeep: OmitDeep = (object: any, ...paths: any) => {\n function omitDeepOnOwnProps(object: any) {\n if (!Array.isArray(object) && !isPlainObject(object)) {\n return object;\n }\n\n if (Array.isArray(object)) {\n return object.map((element) => (needOmit(element) ? omitDeep(element, ...paths) : element));\n }\n\n const temp = {};\n\n for (const [key, value] of Object.entries<{\n [x: string]: object | PropertyName;\n }>(object)) {\n (temp as any)[key] = needOmit(value) ? omitDeep(value, ...paths) : value;\n }\n return omit(temp, ...paths);\n }\n\n return omitDeepOnOwnProps(object);\n};\n"],"names":["needOmit","value","isNil","isPlainObject","omitDeep","object","paths","omitDeepOnOwnProps","element","temp","key","omit"],"mappings":"0GAIaA,EAAYC,GACvB,CAACC,EAAAA,MAAMD,CAAK,IAAME,EAAA,cAAcF,CAAK,GAAK,MAAM,QAAQA,CAAK,GAiClDG,EAAqB,CAACC,KAAgBC,IAAe,CAChE,SAASC,EAAmBF,EAAa,CACnC,GAAA,CAAC,MAAM,QAAQA,CAAM,GAAK,CAACF,EAAAA,cAAcE,CAAM,EAC1CA,OAAAA,EAGL,GAAA,MAAM,QAAQA,CAAM,EACtB,OAAOA,EAAO,IAAKG,GAAaR,EAASQ,CAAO,EAAIJ,EAASI,EAAS,GAAGF,CAAK,EAAIE,CAAQ,EAG5F,MAAMC,EAAO,CAAC,EAEd,SAAW,CAACC,EAAKT,CAAK,IAAK,OAAO,QAE/BI,CAAM,EACNI,EAAaC,CAAG,EAAIV,EAASC,CAAK,EAAIG,EAASH,EAAO,GAAGK,CAAK,EAAIL,EAE9D,OAAAU,EAAA,KAAKF,EAAM,GAAGH,CAAK,CAAA,CAG5B,OAAOC,EAAmBF,CAAM,CAClC"}
1
+ {"version":3,"file":"omitDeep.cjs","sources":["../../../src/omitDeep/omitDeep.ts"],"sourcesContent":["import type { Many, PartialObject, PropertyName } from 'lodash';\n\nimport lodash from 'lodash';\n\nexport const needOmit = (value: any) =>\n !lodash.isNil(value) && (lodash.isPlainObject(value) || Array.isArray(value));\n\ninterface OmitDeep {\n <T extends object, K extends PropertyName[]>(\n object: T | null | undefined,\n ...paths: K\n ): Pick<T, Exclude<keyof T, K[number]>>;\n <T extends object, K extends keyof T>(\n object: T | null | undefined,\n ...paths: Many<K>[]\n ): Omit<T, K>;\n <T extends object>(\n object: T | null | undefined,\n ...paths: Many<PropertyName>[]\n ): PartialObject<T>;\n}\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable properties of `object` that are not omitted.\n *\n * @category Function\n * @param object The source object.\n * @param [paths] The property names to omit, specified\n * individually or in arrays.\n * @returns Returns the new object.\n * @example\n *\n * const object = { 'a': 1, 'b': 2, 'c': { 'a': 1, 'b': 2 } };\n *\n * omitDeep(object, ['b', 'a']);\n * // => { 'c': {} }\n */\nexport const omitDeep: OmitDeep = (object: any, ...paths: any) => {\n function omitDeepOnOwnProps(object: any) {\n if (!Array.isArray(object) && !lodash.isPlainObject(object)) {\n return object;\n }\n\n if (Array.isArray(object)) {\n return object.map((element) => (needOmit(element) ? omitDeep(element, ...paths) : element));\n }\n\n const temp = {};\n\n for (const [key, value] of Object.entries<{\n [x: string]: object | PropertyName;\n }>(object)) {\n (temp as any)[key] = needOmit(value) ? omitDeep(value, ...paths) : value;\n }\n return lodash.omit(temp, ...paths);\n }\n\n return omitDeepOnOwnProps(object);\n};\n"],"names":["needOmit","value","lodash","omitDeep","object","paths","omitDeepOnOwnProps","element","temp","key"],"mappings":"0GAIaA,EAAYC,GACvB,CAACC,EAAO,MAAMD,CAAK,IAAMC,EAAO,cAAcD,CAAK,GAAK,MAAM,QAAQA,CAAK,GAiChEE,EAAqB,CAACC,KAAgBC,IAAe,CAChE,SAASC,EAAmBF,EAAa,CACnC,GAAA,CAAC,MAAM,QAAQA,CAAM,GAAK,CAACF,EAAO,cAAcE,CAAM,EACjDA,OAAAA,EAGL,GAAA,MAAM,QAAQA,CAAM,EACtB,OAAOA,EAAO,IAAKG,GAAaP,EAASO,CAAO,EAAIJ,EAASI,EAAS,GAAGF,CAAK,EAAIE,CAAQ,EAG5F,MAAMC,EAAO,CAAC,EAEd,SAAW,CAACC,EAAKR,CAAK,IAAK,OAAO,QAE/BG,CAAM,EACNI,EAAaC,CAAG,EAAIT,EAASC,CAAK,EAAIE,EAASF,EAAO,GAAGI,CAAK,EAAIJ,EAErE,OAAOC,EAAO,KAAKM,EAAM,GAAGH,CAAK,CAAA,CAGnC,OAAOC,EAAmBF,CAAM,CAClC"}
@@ -1 +1 @@
1
- {"version":3,"file":"omitDeepBy.cjs","sources":["../../../src/omitDeepBy/omitDeepBy.ts"],"sourcesContent":["import type {\n Dictionary,\n NumericDictionary,\n PartialObject,\n PropertyName,\n ValueKeyIteratee\n} from 'lodash';\n\nimport { isPlainObject, omitBy } from 'lodash';\n\ninterface OmitDeepBy {\n <T>(object: Dictionary<T> | null | undefined, predicate?: ValueKeyIteratee<T>): Dictionary<T>;\n <T>(\n object: NumericDictionary<T> | null | undefined,\n predicate?: ValueKeyIteratee<T>\n ): NumericDictionary<T>;\n <T extends object>(\n object: T | null | undefined,\n predicate: ValueKeyIteratee<T[keyof T]>\n ): PartialObject<T>;\n}\n\n/**\n * The opposite of `_.pickBy`; this method creates an object composed of the\n * own and inherited enumerable properties of `object` that `predicate`\n * doesn't return truthy for.\n *\n * @category Function\n * @param object The source object.\n * @param [predicate] The function invoked per property.\n * @returns Returns the new object.\n * @example\n *\n * const object = { 'a': 1, 'b': null, 'c': { 'a': 1, 'b': null } };\n *\n * omitByDeep(object, _.isNil);\n * // => { 'a': 1, 'c': { 'a': 1 } }\n */\nexport const omitDeepBy: OmitDeepBy = (object: any, cb: any) => {\n function omitByDeepByOnOwnProps(object: any) {\n if (!Array.isArray(object) && !isPlainObject(object)) {\n return object;\n }\n\n if (Array.isArray(object)) {\n return object.map((element) => omitDeepBy(element, cb));\n }\n\n const temp = {};\n\n for (const [key, value] of Object.entries<{\n [x: string]: object | PropertyName;\n }>(object)) {\n (temp as any)[key] = omitDeepBy(value, cb);\n }\n return omitBy(temp, cb);\n }\n\n return omitByDeepByOnOwnProps(object);\n};\n"],"names":["omitDeepBy","object","cb","omitByDeepByOnOwnProps","isPlainObject","element","temp","key","value","omitBy"],"mappings":"0GAsCaA,EAAyB,CAACC,EAAaC,IAAY,CAC9D,SAASC,EAAuBF,EAAa,CACvC,GAAA,CAAC,MAAM,QAAQA,CAAM,GAAK,CAACG,EAAAA,cAAcH,CAAM,EAC1CA,OAAAA,EAGL,GAAA,MAAM,QAAQA,CAAM,EACtB,OAAOA,EAAO,IAAKI,GAAYL,EAAWK,EAASH,CAAE,CAAC,EAGxD,MAAMI,EAAO,CAAC,EAEd,SAAW,CAACC,EAAKC,CAAK,IAAK,OAAO,QAE/BP,CAAM,EACNK,EAAaC,CAAG,EAAIP,EAAWQ,EAAON,CAAE,EAEpC,OAAAO,EAAA,OAAOH,EAAMJ,CAAE,CAAA,CAGxB,OAAOC,EAAuBF,CAAM,CACtC"}
1
+ {"version":3,"file":"omitDeepBy.cjs","sources":["../../../src/omitDeepBy/omitDeepBy.ts"],"sourcesContent":["import type {\n Dictionary,\n NumericDictionary,\n PartialObject,\n PropertyName,\n ValueKeyIteratee\n} from 'lodash';\n\nimport lodash from 'lodash';\n\ninterface OmitDeepBy {\n <T>(object: Dictionary<T> | null | undefined, predicate?: ValueKeyIteratee<T>): Dictionary<T>;\n <T>(\n object: NumericDictionary<T> | null | undefined,\n predicate?: ValueKeyIteratee<T>\n ): NumericDictionary<T>;\n <T extends object>(\n object: T | null | undefined,\n predicate: ValueKeyIteratee<T[keyof T]>\n ): PartialObject<T>;\n}\n\n/**\n * The opposite of `_.pickBy`; this method creates an object composed of the\n * own and inherited enumerable properties of `object` that `predicate`\n * doesn't return truthy for.\n *\n * @category Function\n * @param object The source object.\n * @param [predicate] The function invoked per property.\n * @returns Returns the new object.\n * @example\n *\n * const object = { 'a': 1, 'b': null, 'c': { 'a': 1, 'b': null } };\n *\n * omitByDeep(object, _.isNil);\n * // => { 'a': 1, 'c': { 'a': 1 } }\n */\nexport const omitDeepBy: OmitDeepBy = (object: any, cb: any) => {\n function omitByDeepByOnOwnProps(object: any) {\n if (!Array.isArray(object) && !lodash.isPlainObject(object)) {\n return object;\n }\n\n if (Array.isArray(object)) {\n return object.map((element) => omitDeepBy(element, cb));\n }\n\n const temp = {};\n\n for (const [key, value] of Object.entries<{\n [x: string]: object | PropertyName;\n }>(object)) {\n (temp as any)[key] = omitDeepBy(value, cb);\n }\n return lodash.omitBy(temp, cb);\n }\n\n return omitByDeepByOnOwnProps(object);\n};\n"],"names":["omitDeepBy","object","cb","omitByDeepByOnOwnProps","lodash","element","temp","key","value"],"mappings":"0GAsCaA,EAAyB,CAACC,EAAaC,IAAY,CAC9D,SAASC,EAAuBF,EAAa,CACvC,GAAA,CAAC,MAAM,QAAQA,CAAM,GAAK,CAACG,EAAO,cAAcH,CAAM,EACjDA,OAAAA,EAGL,GAAA,MAAM,QAAQA,CAAM,EACtB,OAAOA,EAAO,IAAKI,GAAYL,EAAWK,EAASH,CAAE,CAAC,EAGxD,MAAMI,EAAO,CAAC,EAEd,SAAW,CAACC,EAAKC,CAAK,IAAK,OAAO,QAE/BP,CAAM,EACNK,EAAaC,CAAG,EAAIP,EAAWQ,EAAON,CAAE,EAEpC,OAAAE,EAAO,OAAOE,EAAMJ,CAAE,CAAA,CAG/B,OAAOC,EAAuBF,CAAM,CACtC"}
@@ -1,19 +1,19 @@
1
- import { isPlainObject as m, omit as a, isNil as e } from "lodash";
2
- const y = (i) => !e(i) && (m(i) || Array.isArray(i)), f = (i, ...t) => {
3
- function A(r) {
4
- if (!Array.isArray(r) && !m(r))
1
+ import s from "lodash";
2
+ const y = (i) => !s.isNil(i) && (s.isPlainObject(i) || Array.isArray(i)), e = (i, ...t) => {
3
+ function f(r) {
4
+ if (!Array.isArray(r) && !s.isPlainObject(r))
5
5
  return r;
6
6
  if (Array.isArray(r))
7
- return r.map((n) => y(n) ? f(n, ...t) : n);
8
- const s = {};
7
+ return r.map((n) => y(n) ? e(n, ...t) : n);
8
+ const a = {};
9
9
  for (const [n, o] of Object.entries(r))
10
- s[n] = y(o) ? f(o, ...t) : o;
11
- return a(s, ...t);
10
+ a[n] = y(o) ? e(o, ...t) : o;
11
+ return s.omit(a, ...t);
12
12
  }
13
- return A(i);
13
+ return f(i);
14
14
  };
15
15
  export {
16
16
  y as needOmit,
17
- f as omitDeep
17
+ e as omitDeep
18
18
  };
19
19
  //# sourceMappingURL=omitDeep.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"omitDeep.mjs","sources":["../../../src/omitDeep/omitDeep.ts"],"sourcesContent":["import type { Many, PartialObject, PropertyName } from 'lodash';\n\nimport { isNil, isPlainObject, omit } from 'lodash';\n\nexport const needOmit = (value: any) =>\n !isNil(value) && (isPlainObject(value) || Array.isArray(value));\n\ninterface OmitDeep {\n <T extends object, K extends PropertyName[]>(\n object: T | null | undefined,\n ...paths: K\n ): Pick<T, Exclude<keyof T, K[number]>>;\n <T extends object, K extends keyof T>(\n object: T | null | undefined,\n ...paths: Many<K>[]\n ): Omit<T, K>;\n <T extends object>(\n object: T | null | undefined,\n ...paths: Many<PropertyName>[]\n ): PartialObject<T>;\n}\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable properties of `object` that are not omitted.\n *\n * @category Function\n * @param object The source object.\n * @param [paths] The property names to omit, specified\n * individually or in arrays.\n * @returns Returns the new object.\n * @example\n *\n * const object = { 'a': 1, 'b': 2, 'c': { 'a': 1, 'b': 2 } };\n *\n * omitDeep(object, ['b', 'a']);\n * // => { 'c': {} }\n */\nexport const omitDeep: OmitDeep = (object: any, ...paths: any) => {\n function omitDeepOnOwnProps(object: any) {\n if (!Array.isArray(object) && !isPlainObject(object)) {\n return object;\n }\n\n if (Array.isArray(object)) {\n return object.map((element) => (needOmit(element) ? omitDeep(element, ...paths) : element));\n }\n\n const temp = {};\n\n for (const [key, value] of Object.entries<{\n [x: string]: object | PropertyName;\n }>(object)) {\n (temp as any)[key] = needOmit(value) ? omitDeep(value, ...paths) : value;\n }\n return omit(temp, ...paths);\n }\n\n return omitDeepOnOwnProps(object);\n};\n"],"names":["needOmit","value","isNil","isPlainObject","omitDeep","object","paths","omitDeepOnOwnProps","element","temp","key","omit"],"mappings":";AAIO,MAAMA,IAAW,CAACC,MACvB,CAACC,EAAMD,CAAK,MAAME,EAAcF,CAAK,KAAK,MAAM,QAAQA,CAAK,IAiClDG,IAAqB,CAACC,MAAgBC,MAAe;AAChE,WAASC,EAAmBF,GAAa;AACnC,QAAA,CAAC,MAAM,QAAQA,CAAM,KAAK,CAACF,EAAcE,CAAM;AAC1CA,aAAAA;AAGL,QAAA,MAAM,QAAQA,CAAM;AACtB,aAAOA,EAAO,IAAI,CAACG,MAAaR,EAASQ,CAAO,IAAIJ,EAASI,GAAS,GAAGF,CAAK,IAAIE,CAAQ;AAG5F,UAAMC,IAAO,CAAC;AAEd,eAAW,CAACC,GAAKT,CAAK,KAAK,OAAO,QAE/BI,CAAM;AACN,MAAAI,EAAaC,CAAG,IAAIV,EAASC,CAAK,IAAIG,EAASH,GAAO,GAAGK,CAAK,IAAIL;AAE9D,WAAAU,EAAKF,GAAM,GAAGH,CAAK;AAAA,EAAA;AAG5B,SAAOC,EAAmBF,CAAM;AAClC;"}
1
+ {"version":3,"file":"omitDeep.mjs","sources":["../../../src/omitDeep/omitDeep.ts"],"sourcesContent":["import type { Many, PartialObject, PropertyName } from 'lodash';\n\nimport lodash from 'lodash';\n\nexport const needOmit = (value: any) =>\n !lodash.isNil(value) && (lodash.isPlainObject(value) || Array.isArray(value));\n\ninterface OmitDeep {\n <T extends object, K extends PropertyName[]>(\n object: T | null | undefined,\n ...paths: K\n ): Pick<T, Exclude<keyof T, K[number]>>;\n <T extends object, K extends keyof T>(\n object: T | null | undefined,\n ...paths: Many<K>[]\n ): Omit<T, K>;\n <T extends object>(\n object: T | null | undefined,\n ...paths: Many<PropertyName>[]\n ): PartialObject<T>;\n}\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable properties of `object` that are not omitted.\n *\n * @category Function\n * @param object The source object.\n * @param [paths] The property names to omit, specified\n * individually or in arrays.\n * @returns Returns the new object.\n * @example\n *\n * const object = { 'a': 1, 'b': 2, 'c': { 'a': 1, 'b': 2 } };\n *\n * omitDeep(object, ['b', 'a']);\n * // => { 'c': {} }\n */\nexport const omitDeep: OmitDeep = (object: any, ...paths: any) => {\n function omitDeepOnOwnProps(object: any) {\n if (!Array.isArray(object) && !lodash.isPlainObject(object)) {\n return object;\n }\n\n if (Array.isArray(object)) {\n return object.map((element) => (needOmit(element) ? omitDeep(element, ...paths) : element));\n }\n\n const temp = {};\n\n for (const [key, value] of Object.entries<{\n [x: string]: object | PropertyName;\n }>(object)) {\n (temp as any)[key] = needOmit(value) ? omitDeep(value, ...paths) : value;\n }\n return lodash.omit(temp, ...paths);\n }\n\n return omitDeepOnOwnProps(object);\n};\n"],"names":["needOmit","value","lodash","omitDeep","object","paths","omitDeepOnOwnProps","element","temp","key"],"mappings":";AAIO,MAAMA,IAAW,CAACC,MACvB,CAACC,EAAO,MAAMD,CAAK,MAAMC,EAAO,cAAcD,CAAK,KAAK,MAAM,QAAQA,CAAK,IAiChEE,IAAqB,CAACC,MAAgBC,MAAe;AAChE,WAASC,EAAmBF,GAAa;AACnC,QAAA,CAAC,MAAM,QAAQA,CAAM,KAAK,CAACF,EAAO,cAAcE,CAAM;AACjDA,aAAAA;AAGL,QAAA,MAAM,QAAQA,CAAM;AACtB,aAAOA,EAAO,IAAI,CAACG,MAAaP,EAASO,CAAO,IAAIJ,EAASI,GAAS,GAAGF,CAAK,IAAIE,CAAQ;AAG5F,UAAMC,IAAO,CAAC;AAEd,eAAW,CAACC,GAAKR,CAAK,KAAK,OAAO,QAE/BG,CAAM;AACN,MAAAI,EAAaC,CAAG,IAAIT,EAASC,CAAK,IAAIE,EAASF,GAAO,GAAGI,CAAK,IAAIJ;AAErE,WAAOC,EAAO,KAAKM,GAAM,GAAGH,CAAK;AAAA,EAAA;AAGnC,SAAOC,EAAmBF,CAAM;AAClC;"}
@@ -1,18 +1,18 @@
1
- import { isPlainObject as a, omitBy as m } from "lodash";
2
- const e = (y, n) => {
3
- function o(r) {
4
- if (!Array.isArray(r) && !a(r))
1
+ import e from "lodash";
2
+ const o = (s, n) => {
3
+ function y(r) {
4
+ if (!Array.isArray(r) && !e.isPlainObject(r))
5
5
  return r;
6
6
  if (Array.isArray(r))
7
- return r.map((i) => e(i, n));
7
+ return r.map((i) => o(i, n));
8
8
  const t = {};
9
- for (const [i, s] of Object.entries(r))
10
- t[i] = e(s, n);
11
- return m(t, n);
9
+ for (const [i, a] of Object.entries(r))
10
+ t[i] = o(a, n);
11
+ return e.omitBy(t, n);
12
12
  }
13
- return o(y);
13
+ return y(s);
14
14
  };
15
15
  export {
16
- e as omitDeepBy
16
+ o as omitDeepBy
17
17
  };
18
18
  //# sourceMappingURL=omitDeepBy.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"omitDeepBy.mjs","sources":["../../../src/omitDeepBy/omitDeepBy.ts"],"sourcesContent":["import type {\n Dictionary,\n NumericDictionary,\n PartialObject,\n PropertyName,\n ValueKeyIteratee\n} from 'lodash';\n\nimport { isPlainObject, omitBy } from 'lodash';\n\ninterface OmitDeepBy {\n <T>(object: Dictionary<T> | null | undefined, predicate?: ValueKeyIteratee<T>): Dictionary<T>;\n <T>(\n object: NumericDictionary<T> | null | undefined,\n predicate?: ValueKeyIteratee<T>\n ): NumericDictionary<T>;\n <T extends object>(\n object: T | null | undefined,\n predicate: ValueKeyIteratee<T[keyof T]>\n ): PartialObject<T>;\n}\n\n/**\n * The opposite of `_.pickBy`; this method creates an object composed of the\n * own and inherited enumerable properties of `object` that `predicate`\n * doesn't return truthy for.\n *\n * @category Function\n * @param object The source object.\n * @param [predicate] The function invoked per property.\n * @returns Returns the new object.\n * @example\n *\n * const object = { 'a': 1, 'b': null, 'c': { 'a': 1, 'b': null } };\n *\n * omitByDeep(object, _.isNil);\n * // => { 'a': 1, 'c': { 'a': 1 } }\n */\nexport const omitDeepBy: OmitDeepBy = (object: any, cb: any) => {\n function omitByDeepByOnOwnProps(object: any) {\n if (!Array.isArray(object) && !isPlainObject(object)) {\n return object;\n }\n\n if (Array.isArray(object)) {\n return object.map((element) => omitDeepBy(element, cb));\n }\n\n const temp = {};\n\n for (const [key, value] of Object.entries<{\n [x: string]: object | PropertyName;\n }>(object)) {\n (temp as any)[key] = omitDeepBy(value, cb);\n }\n return omitBy(temp, cb);\n }\n\n return omitByDeepByOnOwnProps(object);\n};\n"],"names":["omitDeepBy","object","cb","omitByDeepByOnOwnProps","isPlainObject","element","temp","key","value","omitBy"],"mappings":";AAsCa,MAAAA,IAAyB,CAACC,GAAaC,MAAY;AAC9D,WAASC,EAAuBF,GAAa;AACvC,QAAA,CAAC,MAAM,QAAQA,CAAM,KAAK,CAACG,EAAcH,CAAM;AAC1CA,aAAAA;AAGL,QAAA,MAAM,QAAQA,CAAM;AACtB,aAAOA,EAAO,IAAI,CAACI,MAAYL,EAAWK,GAASH,CAAE,CAAC;AAGxD,UAAMI,IAAO,CAAC;AAEd,eAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAE/BP,CAAM;AACN,MAAAK,EAAaC,CAAG,IAAIP,EAAWQ,GAAON,CAAE;AAEpC,WAAAO,EAAOH,GAAMJ,CAAE;AAAA,EAAA;AAGxB,SAAOC,EAAuBF,CAAM;AACtC;"}
1
+ {"version":3,"file":"omitDeepBy.mjs","sources":["../../../src/omitDeepBy/omitDeepBy.ts"],"sourcesContent":["import type {\n Dictionary,\n NumericDictionary,\n PartialObject,\n PropertyName,\n ValueKeyIteratee\n} from 'lodash';\n\nimport lodash from 'lodash';\n\ninterface OmitDeepBy {\n <T>(object: Dictionary<T> | null | undefined, predicate?: ValueKeyIteratee<T>): Dictionary<T>;\n <T>(\n object: NumericDictionary<T> | null | undefined,\n predicate?: ValueKeyIteratee<T>\n ): NumericDictionary<T>;\n <T extends object>(\n object: T | null | undefined,\n predicate: ValueKeyIteratee<T[keyof T]>\n ): PartialObject<T>;\n}\n\n/**\n * The opposite of `_.pickBy`; this method creates an object composed of the\n * own and inherited enumerable properties of `object` that `predicate`\n * doesn't return truthy for.\n *\n * @category Function\n * @param object The source object.\n * @param [predicate] The function invoked per property.\n * @returns Returns the new object.\n * @example\n *\n * const object = { 'a': 1, 'b': null, 'c': { 'a': 1, 'b': null } };\n *\n * omitByDeep(object, _.isNil);\n * // => { 'a': 1, 'c': { 'a': 1 } }\n */\nexport const omitDeepBy: OmitDeepBy = (object: any, cb: any) => {\n function omitByDeepByOnOwnProps(object: any) {\n if (!Array.isArray(object) && !lodash.isPlainObject(object)) {\n return object;\n }\n\n if (Array.isArray(object)) {\n return object.map((element) => omitDeepBy(element, cb));\n }\n\n const temp = {};\n\n for (const [key, value] of Object.entries<{\n [x: string]: object | PropertyName;\n }>(object)) {\n (temp as any)[key] = omitDeepBy(value, cb);\n }\n return lodash.omitBy(temp, cb);\n }\n\n return omitByDeepByOnOwnProps(object);\n};\n"],"names":["omitDeepBy","object","cb","omitByDeepByOnOwnProps","lodash","element","temp","key","value"],"mappings":";AAsCa,MAAAA,IAAyB,CAACC,GAAaC,MAAY;AAC9D,WAASC,EAAuBF,GAAa;AACvC,QAAA,CAAC,MAAM,QAAQA,CAAM,KAAK,CAACG,EAAO,cAAcH,CAAM;AACjDA,aAAAA;AAGL,QAAA,MAAM,QAAQA,CAAM;AACtB,aAAOA,EAAO,IAAI,CAACI,MAAYL,EAAWK,GAASH,CAAE,CAAC;AAGxD,UAAMI,IAAO,CAAC;AAEd,eAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAE/BP,CAAM;AACN,MAAAK,EAAaC,CAAG,IAAIP,EAAWQ,GAAON,CAAE;AAEpC,WAAAE,EAAO,OAAOE,GAAMJ,CAAE;AAAA,EAAA;AAG/B,SAAOC,EAAuBF,CAAM;AACtC;"}
package/package.json CHANGED
@@ -1,82 +1,82 @@
1
- {
2
- "name": "lodash-omitdeep",
3
- "type": "module",
4
- "version": "1.5.2",
5
- "description": "lodash omitDeep/omitByDeep object key/value recursively",
6
- "author": {
7
- "name": "SIBERIA CAN CODE 🧊",
8
- "url": "https://github.com/siberiacancode"
9
- },
10
- "license": "MIT",
11
- "homepage": "https://github.com/siberiacancode/lodash-omitdeep",
12
- "repository": {
13
- "type": "git",
14
- "url": "git+https://github.com/siberiacancode/lodash-omitdeep.git"
15
- },
16
- "bugs": {
17
- "url": "https://github.com/siberiacancode/lodash-omitdeep/issues"
18
- },
19
- "keywords": [
20
- "lodash",
21
- "omit",
22
- "omitDeep",
23
- "omitBy",
24
- "omitByDeep",
25
- "key",
26
- "keys",
27
- "delete",
28
- "remove",
29
- "object",
30
- "deep"
31
- ],
32
- "sideEffects": false,
33
- "exports": {
34
- "types": "./dist/types/index.d.ts",
35
- "import": "./dist/esm/index.mjs",
36
- "require": "./dist/cjs/index.cjs"
37
- },
38
- "main": "dist/cjs/index.mjs",
39
- "module": "dist/esm/index.mjs",
40
- "types": "dist/types/index.d.ts",
41
- "files": [
42
- "dist/**/*"
43
- ],
44
- "scripts": {
45
- "build": "shx rm -rf dist && vite build",
46
- "lint": "eslint . --fix",
47
- "type": "tsc --noEmit",
48
- "format": "prettier --write .",
49
- "pretty": "yarn type && yarn lint && yarn format",
50
- "prepare": "husky",
51
- "unit-test": "vitest"
52
- },
53
- "peerDependencies": {
54
- "lodash": "^4.17.21"
55
- },
56
- "dependencies": {
57
- "lodash": "^4.17.21"
58
- },
59
- "devDependencies": {
60
- "@siberiacancode/eslint": "^2.9.0",
61
- "@siberiacancode/prettier": "^1.3.0",
62
- "@siberiacancode/vitest": "^2.1.0",
63
- "@types/lodash": "^4.17.16",
64
- "@types/node": "^22.13.13",
65
- "husky": "^9.1.7",
66
- "lint-staged": "^15.5.0",
67
- "shx": "^0.4.0",
68
- "typescript": "^5.8.2",
69
- "vite": "^6.2.3",
70
- "vite-plugin-dts": "^4.5.3"
71
- },
72
- "lint-staged": {
73
- "*.js": [
74
- "eslint --fix",
75
- "prettier --write"
76
- ],
77
- "*.ts": [
78
- "eslint --fix",
79
- "prettier --write"
80
- ]
81
- }
82
- }
1
+ {
2
+ "name": "lodash-omitdeep",
3
+ "type": "module",
4
+ "version": "1.5.3",
5
+ "description": "lodash omitDeep/omitByDeep object key/value recursively",
6
+ "author": {
7
+ "name": "SIBERIA CAN CODE 🧊",
8
+ "url": "https://github.com/siberiacancode"
9
+ },
10
+ "license": "MIT",
11
+ "homepage": "https://github.com/siberiacancode/lodash-omitdeep",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/siberiacancode/lodash-omitdeep.git"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/siberiacancode/lodash-omitdeep/issues"
18
+ },
19
+ "keywords": [
20
+ "lodash",
21
+ "omit",
22
+ "omitDeep",
23
+ "omitBy",
24
+ "omitByDeep",
25
+ "key",
26
+ "keys",
27
+ "delete",
28
+ "remove",
29
+ "object",
30
+ "deep"
31
+ ],
32
+ "sideEffects": false,
33
+ "exports": {
34
+ "types": "./dist/types/index.d.ts",
35
+ "import": "./dist/esm/index.mjs",
36
+ "require": "./dist/cjs/index.cjs"
37
+ },
38
+ "main": "dist/cjs/index.cjs",
39
+ "module": "dist/esm/index.mjs",
40
+ "types": "dist/types/index.d.ts",
41
+ "files": [
42
+ "dist/**/*"
43
+ ],
44
+ "scripts": {
45
+ "build": "shx rm -rf dist && vite build",
46
+ "lint": "eslint . --fix",
47
+ "type": "tsc --noEmit",
48
+ "format": "prettier --write .",
49
+ "pretty": "yarn type && yarn lint && yarn format",
50
+ "prepare": "husky",
51
+ "unit-test": "vitest"
52
+ },
53
+ "peerDependencies": {
54
+ "lodash": "^4.17.21"
55
+ },
56
+ "dependencies": {
57
+ "lodash": "^4.17.21"
58
+ },
59
+ "devDependencies": {
60
+ "@siberiacancode/eslint": "^2.9.0",
61
+ "@siberiacancode/prettier": "^1.3.0",
62
+ "@siberiacancode/vitest": "^2.1.0",
63
+ "@types/lodash": "^4.17.16",
64
+ "@types/node": "^22.13.14",
65
+ "husky": "^9.1.7",
66
+ "lint-staged": "^15.5.0",
67
+ "shx": "^0.4.0",
68
+ "typescript": "^5.8.2",
69
+ "vite": "^6.2.3",
70
+ "vite-plugin-dts": "^4.5.3"
71
+ },
72
+ "lint-staged": {
73
+ "*.js": [
74
+ "eslint --fix",
75
+ "prettier --write"
76
+ ],
77
+ "*.ts": [
78
+ "eslint --fix",
79
+ "prettier --write"
80
+ ]
81
+ }
82
+ }