lodash-omitdeep 1.8.0 → 1.9.0

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,2 +1,93 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./omitDeep/omitDeep.cjs"),t=require("./omitDeepBy/omitDeepBy.cjs");exports.omitDeep=e.omitDeep;exports.omitDeepBy=t.omitDeepBy;
2
- //# sourceMappingURL=index.cjs.map
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) {
14
+ __defProp(to, key, {
15
+ get: ((k) => from[k]).bind(null, key),
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ }
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+
28
+ //#endregion
29
+ let lodash = require("lodash");
30
+ lodash = __toESM(lodash);
31
+
32
+ //#region src/omitDeep/omitDeep.ts
33
+ const needOmit = (value) => !lodash.default.isNil(value) && (lodash.default.isPlainObject(value) || Array.isArray(value));
34
+ /**
35
+ * The opposite of `_.pick`; this method creates an object composed of the
36
+ * own and inherited enumerable properties of `object` that are not omitted.
37
+ *
38
+ * @category Function
39
+ * @param object The source object.
40
+ * @param [paths] The property names to omit, specified
41
+ * individually or in arrays.
42
+ * @returns Returns the new object.
43
+ * @example
44
+ *
45
+ * const object = { 'a': 1, 'b': 2, 'c': { 'a': 1, 'b': 2 } };
46
+ *
47
+ * omitDeep(object, ['b', 'a']);
48
+ * // => { 'c': {} }
49
+ */
50
+ const omitDeep = (object, ...paths) => {
51
+ function omitDeepOnOwnProps(object) {
52
+ if (!Array.isArray(object) && !lodash.default.isPlainObject(object)) return object;
53
+ if (Array.isArray(object)) return object.map((element) => needOmit(element) ? omitDeep(element, ...paths) : element);
54
+ const temp = {};
55
+ for (const [key, value] of Object.entries(object)) temp[key] = needOmit(value) ? omitDeep(value, ...paths) : value;
56
+ return lodash.default.omit(temp, ...paths);
57
+ }
58
+ return omitDeepOnOwnProps(object);
59
+ };
60
+
61
+ //#endregion
62
+ //#region src/omitDeepBy/omitDeepBy.ts
63
+ /**
64
+ * The opposite of `_.pickBy`; this method creates an object composed of the
65
+ * own and inherited enumerable properties of `object` that `predicate`
66
+ * doesn't return truthy for.
67
+ *
68
+ * @category Function
69
+ * @param object The source object.
70
+ * @param [predicate] The function invoked per property.
71
+ * @returns Returns the new object.
72
+ * @example
73
+ *
74
+ * const object = { 'a': 1, 'b': null, 'c': { 'a': 1, 'b': null } };
75
+ *
76
+ * omitByDeep(object, _.isNil);
77
+ * // => { 'a': 1, 'c': { 'a': 1 } }
78
+ */
79
+ const omitDeepBy = (object, cb) => {
80
+ function omitByDeepByOnOwnProps(object) {
81
+ if (!Array.isArray(object) && !lodash.default.isPlainObject(object)) return object;
82
+ if (Array.isArray(object)) return object.map((element) => omitDeepBy(element, cb));
83
+ const temp = {};
84
+ for (const [key, value] of Object.entries(object)) temp[key] = omitDeepBy(value, cb);
85
+ return lodash.default.omitBy(temp, cb);
86
+ }
87
+ return omitByDeepByOnOwnProps(object);
88
+ };
89
+
90
+ //#endregion
91
+ exports.omitDeep = omitDeep;
92
+ exports.omitDeepBy = omitDeepBy;
93
+ //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/omitDeep/omitDeep.ts","../../src/omitDeepBy/omitDeepBy.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","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAa,YAAY,UACvB,CAAC,eAAO,MAAM,MAAM,KAAK,eAAO,cAAc,MAAM,IAAI,MAAM,QAAQ,MAAM;;;;;;;;;;;;;;;;;AAiC9E,MAAa,YAAsB,QAAa,GAAG,UAAe;CAChE,SAAS,mBAAmB,QAAa;AACvC,MAAI,CAAC,MAAM,QAAQ,OAAO,IAAI,CAAC,eAAO,cAAc,OAAO,CACzD,QAAO;AAGT,MAAI,MAAM,QAAQ,OAAO,CACvB,QAAO,OAAO,KAAK,YAAa,SAAS,QAAQ,GAAG,SAAS,SAAS,GAAG,MAAM,GAAG,QAAS;EAG7F,MAAM,OAAO,EAAE;AAEf,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAE/B,OAAO,CACR,CAAC,KAAa,OAAO,SAAS,MAAM,GAAG,SAAS,OAAO,GAAG,MAAM,GAAG;AAErE,SAAO,eAAO,KAAK,MAAM,GAAG,MAAM;;AAGpC,QAAO,mBAAmB,OAAO;;;;;;;;;;;;;;;;;;;;;ACpBnC,MAAa,cAA0B,QAAa,OAAY;CAC9D,SAAS,uBAAuB,QAAa;AAC3C,MAAI,CAAC,MAAM,QAAQ,OAAO,IAAI,CAAC,eAAO,cAAc,OAAO,CACzD,QAAO;AAGT,MAAI,MAAM,QAAQ,OAAO,CACvB,QAAO,OAAO,KAAK,YAAY,WAAW,SAAS,GAAG,CAAC;EAGzD,MAAM,OAAO,EAAE;AAEf,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAE/B,OAAO,CACR,CAAC,KAAa,OAAO,WAAW,OAAO,GAAG;AAE5C,SAAO,eAAO,OAAO,MAAM,GAAG;;AAGhC,QAAO,uBAAuB,OAAO"}
@@ -0,0 +1,52 @@
1
+ import { Dictionary, Many, NumericDictionary, PartialObject, PropertyName, ValueKeyIteratee } from "lodash";
2
+
3
+ //#region src/omitDeep/omitDeep.d.ts
4
+ interface OmitDeep {
5
+ <T extends object, K extends PropertyName[]>(object: T | null | undefined, ...paths: K): Pick<T, Exclude<keyof T, K[number]>>;
6
+ <T extends object, K extends keyof T>(object: T | null | undefined, ...paths: Many<K>[]): Omit<T, K>;
7
+ <T extends object>(object: T | null | undefined, ...paths: Many<PropertyName>[]): PartialObject<T>;
8
+ }
9
+ /**
10
+ * The opposite of `_.pick`; this method creates an object composed of the
11
+ * own and inherited enumerable properties of `object` that are not omitted.
12
+ *
13
+ * @category Function
14
+ * @param object The source object.
15
+ * @param [paths] The property names to omit, specified
16
+ * individually or in arrays.
17
+ * @returns Returns the new object.
18
+ * @example
19
+ *
20
+ * const object = { 'a': 1, 'b': 2, 'c': { 'a': 1, 'b': 2 } };
21
+ *
22
+ * omitDeep(object, ['b', 'a']);
23
+ * // => { 'c': {} }
24
+ */
25
+ declare const omitDeep: OmitDeep;
26
+ //#endregion
27
+ //#region src/omitDeepBy/omitDeepBy.d.ts
28
+ interface OmitDeepBy {
29
+ <T>(object: Dictionary<T> | null | undefined, predicate?: ValueKeyIteratee<T>): Dictionary<T>;
30
+ <T>(object: NumericDictionary<T> | null | undefined, predicate?: ValueKeyIteratee<T>): NumericDictionary<T>;
31
+ <T extends object>(object: T | null | undefined, predicate: ValueKeyIteratee<T[keyof T]>): PartialObject<T>;
32
+ }
33
+ /**
34
+ * The opposite of `_.pickBy`; this method creates an object composed of the
35
+ * own and inherited enumerable properties of `object` that `predicate`
36
+ * doesn't return truthy for.
37
+ *
38
+ * @category Function
39
+ * @param object The source object.
40
+ * @param [predicate] The function invoked per property.
41
+ * @returns Returns the new object.
42
+ * @example
43
+ *
44
+ * const object = { 'a': 1, 'b': null, 'c': { 'a': 1, 'b': null } };
45
+ *
46
+ * omitByDeep(object, _.isNil);
47
+ * // => { 'a': 1, 'c': { 'a': 1 } }
48
+ */
49
+ declare const omitDeepBy: OmitDeepBy;
50
+ //#endregion
51
+ export { omitDeep, omitDeepBy };
52
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1,52 @@
1
+ import { Dictionary, Many, NumericDictionary, PartialObject, PropertyName, ValueKeyIteratee } from "lodash";
2
+
3
+ //#region src/omitDeep/omitDeep.d.ts
4
+ interface OmitDeep {
5
+ <T extends object, K extends PropertyName[]>(object: T | null | undefined, ...paths: K): Pick<T, Exclude<keyof T, K[number]>>;
6
+ <T extends object, K extends keyof T>(object: T | null | undefined, ...paths: Many<K>[]): Omit<T, K>;
7
+ <T extends object>(object: T | null | undefined, ...paths: Many<PropertyName>[]): PartialObject<T>;
8
+ }
9
+ /**
10
+ * The opposite of `_.pick`; this method creates an object composed of the
11
+ * own and inherited enumerable properties of `object` that are not omitted.
12
+ *
13
+ * @category Function
14
+ * @param object The source object.
15
+ * @param [paths] The property names to omit, specified
16
+ * individually or in arrays.
17
+ * @returns Returns the new object.
18
+ * @example
19
+ *
20
+ * const object = { 'a': 1, 'b': 2, 'c': { 'a': 1, 'b': 2 } };
21
+ *
22
+ * omitDeep(object, ['b', 'a']);
23
+ * // => { 'c': {} }
24
+ */
25
+ declare const omitDeep: OmitDeep;
26
+ //#endregion
27
+ //#region src/omitDeepBy/omitDeepBy.d.ts
28
+ interface OmitDeepBy {
29
+ <T>(object: Dictionary<T> | null | undefined, predicate?: ValueKeyIteratee<T>): Dictionary<T>;
30
+ <T>(object: NumericDictionary<T> | null | undefined, predicate?: ValueKeyIteratee<T>): NumericDictionary<T>;
31
+ <T extends object>(object: T | null | undefined, predicate: ValueKeyIteratee<T[keyof T]>): PartialObject<T>;
32
+ }
33
+ /**
34
+ * The opposite of `_.pickBy`; this method creates an object composed of the
35
+ * own and inherited enumerable properties of `object` that `predicate`
36
+ * doesn't return truthy for.
37
+ *
38
+ * @category Function
39
+ * @param object The source object.
40
+ * @param [predicate] The function invoked per property.
41
+ * @returns Returns the new object.
42
+ * @example
43
+ *
44
+ * const object = { 'a': 1, 'b': null, 'c': { 'a': 1, 'b': null } };
45
+ *
46
+ * omitByDeep(object, _.isNil);
47
+ * // => { 'a': 1, 'c': { 'a': 1 } }
48
+ */
49
+ declare const omitDeepBy: OmitDeepBy;
50
+ //#endregion
51
+ export { omitDeep, omitDeepBy };
52
+ //# sourceMappingURL=index.d.mts.map
@@ -1,7 +1,63 @@
1
- import { omitDeep as m } from "./omitDeep/omitDeep.mjs";
2
- import { omitDeepBy as r } from "./omitDeepBy/omitDeepBy.mjs";
3
- export {
4
- m as omitDeep,
5
- r as omitDeepBy
1
+ import lodash from "lodash";
2
+
3
+ //#region src/omitDeep/omitDeep.ts
4
+ const needOmit = (value) => !lodash.isNil(value) && (lodash.isPlainObject(value) || Array.isArray(value));
5
+ /**
6
+ * The opposite of `_.pick`; this method creates an object composed of the
7
+ * own and inherited enumerable properties of `object` that are not omitted.
8
+ *
9
+ * @category Function
10
+ * @param object The source object.
11
+ * @param [paths] The property names to omit, specified
12
+ * individually or in arrays.
13
+ * @returns Returns the new object.
14
+ * @example
15
+ *
16
+ * const object = { 'a': 1, 'b': 2, 'c': { 'a': 1, 'b': 2 } };
17
+ *
18
+ * omitDeep(object, ['b', 'a']);
19
+ * // => { 'c': {} }
20
+ */
21
+ const omitDeep = (object, ...paths) => {
22
+ function omitDeepOnOwnProps(object) {
23
+ if (!Array.isArray(object) && !lodash.isPlainObject(object)) return object;
24
+ if (Array.isArray(object)) return object.map((element) => needOmit(element) ? omitDeep(element, ...paths) : element);
25
+ const temp = {};
26
+ for (const [key, value] of Object.entries(object)) temp[key] = needOmit(value) ? omitDeep(value, ...paths) : value;
27
+ return lodash.omit(temp, ...paths);
28
+ }
29
+ return omitDeepOnOwnProps(object);
6
30
  };
7
- //# sourceMappingURL=index.mjs.map
31
+
32
+ //#endregion
33
+ //#region src/omitDeepBy/omitDeepBy.ts
34
+ /**
35
+ * The opposite of `_.pickBy`; this method creates an object composed of the
36
+ * own and inherited enumerable properties of `object` that `predicate`
37
+ * doesn't return truthy for.
38
+ *
39
+ * @category Function
40
+ * @param object The source object.
41
+ * @param [predicate] The function invoked per property.
42
+ * @returns Returns the new object.
43
+ * @example
44
+ *
45
+ * const object = { 'a': 1, 'b': null, 'c': { 'a': 1, 'b': null } };
46
+ *
47
+ * omitByDeep(object, _.isNil);
48
+ * // => { 'a': 1, 'c': { 'a': 1 } }
49
+ */
50
+ const omitDeepBy = (object, cb) => {
51
+ function omitByDeepByOnOwnProps(object) {
52
+ if (!Array.isArray(object) && !lodash.isPlainObject(object)) return object;
53
+ if (Array.isArray(object)) return object.map((element) => omitDeepBy(element, cb));
54
+ const temp = {};
55
+ for (const [key, value] of Object.entries(object)) temp[key] = omitDeepBy(value, cb);
56
+ return lodash.omitBy(temp, cb);
57
+ }
58
+ return omitByDeepByOnOwnProps(object);
59
+ };
60
+
61
+ //#endregion
62
+ export { omitDeep, omitDeepBy };
63
+ //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/omitDeep/omitDeep.ts","../../src/omitDeepBy/omitDeepBy.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","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"],"mappings":";;;AAIA,MAAa,YAAY,UACvB,CAAC,OAAO,MAAM,MAAM,KAAK,OAAO,cAAc,MAAM,IAAI,MAAM,QAAQ,MAAM;;;;;;;;;;;;;;;;;AAiC9E,MAAa,YAAsB,QAAa,GAAG,UAAe;CAChE,SAAS,mBAAmB,QAAa;AACvC,MAAI,CAAC,MAAM,QAAQ,OAAO,IAAI,CAAC,OAAO,cAAc,OAAO,CACzD,QAAO;AAGT,MAAI,MAAM,QAAQ,OAAO,CACvB,QAAO,OAAO,KAAK,YAAa,SAAS,QAAQ,GAAG,SAAS,SAAS,GAAG,MAAM,GAAG,QAAS;EAG7F,MAAM,OAAO,EAAE;AAEf,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAE/B,OAAO,CACR,CAAC,KAAa,OAAO,SAAS,MAAM,GAAG,SAAS,OAAO,GAAG,MAAM,GAAG;AAErE,SAAO,OAAO,KAAK,MAAM,GAAG,MAAM;;AAGpC,QAAO,mBAAmB,OAAO;;;;;;;;;;;;;;;;;;;;;ACpBnC,MAAa,cAA0B,QAAa,OAAY;CAC9D,SAAS,uBAAuB,QAAa;AAC3C,MAAI,CAAC,MAAM,QAAQ,OAAO,IAAI,CAAC,OAAO,cAAc,OAAO,CACzD,QAAO;AAGT,MAAI,MAAM,QAAQ,OAAO,CACvB,QAAO,OAAO,KAAK,YAAY,WAAW,SAAS,GAAG,CAAC;EAGzD,MAAM,OAAO,EAAE;AAEf,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAE/B,OAAO,CACR,CAAC,KAAa,OAAO,WAAW,OAAO,GAAG;AAE5C,SAAO,OAAO,OAAO,MAAM,GAAG;;AAGhC,QAAO,uBAAuB,OAAO"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lodash-omitdeep",
3
3
  "type": "module",
4
- "version": "1.8.0",
4
+ "version": "1.9.0",
5
5
  "description": "lodash omitDeep/omitByDeep object key/value recursively",
6
6
  "author": {
7
7
  "name": "SIBERIA CAN CODE 🧊",
@@ -31,19 +31,26 @@
31
31
  ],
32
32
  "sideEffects": false,
33
33
  "exports": {
34
- "types": "./dist/types/index.d.ts",
35
- "import": "./dist/esm/index.mjs",
36
- "require": "./dist/cjs/index.cjs"
34
+ ".": {
35
+ "import": {
36
+ "types": "./dist/esm/index.d.mts",
37
+ "default": "./dist/esm/index.mjs"
38
+ },
39
+ "require": {
40
+ "types": "./dist/cjs/index.d.cts",
41
+ "default": "./dist/cjs/index.cjs"
42
+ }
43
+ }
37
44
  },
38
45
  "main": "dist/cjs/index.cjs",
39
46
  "module": "dist/esm/index.mjs",
40
- "types": "dist/types/index.d.ts",
47
+ "types": "dist/esm/index.d.mts",
41
48
  "files": [
42
49
  "dist"
43
50
  ],
44
51
  "scripts": {
45
52
  "prepublishOnly": "yarn unit-test run && yarn build",
46
- "build": "shx rm -rf dist && vite build && tsc",
53
+ "build": "tsdown",
47
54
  "lint": "eslint . --fix",
48
55
  "type": "tsc --noEmit",
49
56
  "format": "prettier --write .",
@@ -58,17 +65,15 @@
58
65
  "lodash": "^4"
59
66
  },
60
67
  "devDependencies": {
61
- "@siberiacancode/eslint": "^2.15.1",
62
- "@siberiacancode/prettier": "^1.6.0",
63
- "@siberiacancode/vitest": "^2.3.0",
64
- "@types/lodash": "^4.17.23",
65
- "@types/node": "^25.2.2",
68
+ "@siberiacancode/eslint": "^2.15.2",
69
+ "@siberiacancode/prettier": "^1.6.1",
70
+ "@siberiacancode/vitest": "^2.4.1",
71
+ "@types/lodash": "^4.17.24",
72
+ "@types/node": "^25.3.2",
66
73
  "husky": "^9.1.7",
67
74
  "lint-staged": "^16.2.7",
68
- "shx": "^0.4.0",
69
- "typescript": "^5.9.3",
70
- "vite": "^7.3.1",
71
- "vite-plugin-dts": "^4.5.4"
75
+ "tsdown": "^0.20.3",
76
+ "typescript": "^5.9.3"
72
77
  },
73
78
  "lint-staged": {
74
79
  "*.{js,ts}": [
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("lodash"),o=i=>!n.isNil(i)&&(n.isPlainObject(i)||Array.isArray(i)),a=(i,...t)=>{function u(r){if(!Array.isArray(r)&&!n.isPlainObject(r))return r;if(Array.isArray(r))return r.map(e=>o(e)?a(e,...t):e);const y={};for(const[e,s]of Object.entries(r))y[e]=o(s)?a(s,...t):s;return n.omit(y,...t)}return u(i)};exports.needOmit=o;exports.omitDeep=a;
2
- //# sourceMappingURL=omitDeep.cjs.map
@@ -1 +0,0 @@
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,CACvC,GAAI,CAAC,MAAM,QAAQA,CAAM,GAAK,CAACF,EAAO,cAAcE,CAAM,EACxD,OAAOA,EAGT,GAAI,MAAM,QAAQA,CAAM,EACtB,OAAOA,EAAO,IAAKG,GAAaP,EAASO,CAAO,EAAIJ,EAASI,EAAS,GAAGF,CAAK,EAAIE,CAAQ,EAG5F,MAAMC,EAAO,CAAA,EAEb,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,CACnC,CAEA,OAAOC,EAAmBF,CAAM,CAClC"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lodash"),i=(s,e)=>{function y(r){if(!Array.isArray(r)&&!o.isPlainObject(r))return r;if(Array.isArray(r))return r.map(t=>i(t,e));const n={};for(const[t,a]of Object.entries(r))n[t]=i(a,e);return o.omitBy(n,e)}return y(s)};exports.omitDeepBy=i;
2
- //# sourceMappingURL=omitDeepBy.cjs.map
@@ -1 +0,0 @@
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,CAC3C,GAAI,CAAC,MAAM,QAAQA,CAAM,GAAK,CAACG,EAAO,cAAcH,CAAM,EACxD,OAAOA,EAGT,GAAI,MAAM,QAAQA,CAAM,EACtB,OAAOA,EAAO,IAAKI,GAAYL,EAAWK,EAASH,CAAE,CAAC,EAGxD,MAAMI,EAAO,CAAA,EAEb,SAAW,CAACC,EAAKC,CAAK,IAAK,OAAO,QAE/BP,CAAM,EACNK,EAAaC,CAAG,EAAIP,EAAWQ,EAAON,CAAE,EAE3C,OAAOE,EAAO,OAAOE,EAAMJ,CAAE,CAC/B,CAEA,OAAOC,EAAuBF,CAAM,CACtC"}
@@ -1,19 +0,0 @@
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
- return r;
6
- if (Array.isArray(r))
7
- return r.map((n) => y(n) ? e(n, ...t) : n);
8
- const a = {};
9
- for (const [n, o] of Object.entries(r))
10
- a[n] = y(o) ? e(o, ...t) : o;
11
- return s.omit(a, ...t);
12
- }
13
- return f(i);
14
- };
15
- export {
16
- y as needOmit,
17
- e as omitDeep
18
- };
19
- //# sourceMappingURL=omitDeep.mjs.map
@@ -1 +0,0 @@
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;AACvC,QAAI,CAAC,MAAM,QAAQA,CAAM,KAAK,CAACF,EAAO,cAAcE,CAAM;AACxD,aAAOA;AAGT,QAAI,MAAM,QAAQA,CAAM;AACtB,aAAOA,EAAO,IAAI,CAACG,MAAaP,EAASO,CAAO,IAAIJ,EAASI,GAAS,GAAGF,CAAK,IAAIE,CAAQ;AAG5F,UAAMC,IAAO,CAAA;AAEb,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,EACnC;AAEA,SAAOC,EAAmBF,CAAM;AAClC;"}
@@ -1,18 +0,0 @@
1
- import e from "lodash";
2
- const o = (s, n) => {
3
- function y(r) {
4
- if (!Array.isArray(r) && !e.isPlainObject(r))
5
- return r;
6
- if (Array.isArray(r))
7
- return r.map((i) => o(i, n));
8
- const t = {};
9
- for (const [i, a] of Object.entries(r))
10
- t[i] = o(a, n);
11
- return e.omitBy(t, n);
12
- }
13
- return y(s);
14
- };
15
- export {
16
- o as omitDeepBy
17
- };
18
- //# sourceMappingURL=omitDeepBy.mjs.map
@@ -1 +0,0 @@
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":";AAsCO,MAAMA,IAAyB,CAACC,GAAaC,MAAY;AAC9D,WAASC,EAAuBF,GAAa;AAC3C,QAAI,CAAC,MAAM,QAAQA,CAAM,KAAK,CAACG,EAAO,cAAcH,CAAM;AACxD,aAAOA;AAGT,QAAI,MAAM,QAAQA,CAAM;AACtB,aAAOA,EAAO,IAAI,CAACI,MAAYL,EAAWK,GAASH,CAAE,CAAC;AAGxD,UAAMI,IAAO,CAAA;AAEb,eAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAE/BP,CAAM;AACN,MAAAK,EAAaC,CAAG,IAAIP,EAAWQ,GAAON,CAAE;AAE3C,WAAOE,EAAO,OAAOE,GAAMJ,CAAE;AAAA,EAC/B;AAEA,SAAOC,EAAuBF,CAAM;AACtC;"}