lodash-omitdeep 1.5.0 → 1.5.2
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.
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { omitDeepBy as r } from "./omitDeepBy/omitDeepBy.cjs";
|
|
3
|
-
export {
|
|
4
|
-
m as omitDeep,
|
|
5
|
-
r as omitDeepBy
|
|
6
|
-
};
|
|
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;
|
|
7
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
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))
|
|
5
|
-
return r;
|
|
6
|
-
if (Array.isArray(r))
|
|
7
|
-
return r.map((n) => y(n) ? f(n, ...t) : n);
|
|
8
|
-
const s = {};
|
|
9
|
-
for (const [n, o] of Object.entries(r))
|
|
10
|
-
s[n] = y(o) ? f(o, ...t) : o;
|
|
11
|
-
return a(s, ...t);
|
|
12
|
-
}
|
|
13
|
-
return A(i);
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
y as needOmit,
|
|
17
|
-
f as omitDeep
|
|
18
|
-
};
|
|
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;
|
|
19
2
|
//# sourceMappingURL=omitDeep.cjs.map
|
|
@@ -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":"
|
|
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,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
const e = (y, n) => {
|
|
3
|
-
function o(r) {
|
|
4
|
-
if (!Array.isArray(r) && !a(r))
|
|
5
|
-
return r;
|
|
6
|
-
if (Array.isArray(r))
|
|
7
|
-
return r.map((i) => e(i, n));
|
|
8
|
-
const t = {};
|
|
9
|
-
for (const [i, s] of Object.entries(r))
|
|
10
|
-
t[i] = e(s, n);
|
|
11
|
-
return m(t, n);
|
|
12
|
-
}
|
|
13
|
-
return o(y);
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
e as omitDeepBy
|
|
17
|
-
};
|
|
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;
|
|
18
2
|
//# sourceMappingURL=omitDeepBy.cjs.map
|
|
@@ -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":"
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lodash-omitdeep",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.2",
|
|
5
5
|
"description": "lodash omitDeep/omitByDeep object key/value recursively",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "SIBERIA CAN CODE 🧊",
|
|
@@ -31,14 +31,12 @@
|
|
|
31
31
|
],
|
|
32
32
|
"sideEffects": false,
|
|
33
33
|
"exports": {
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"require": "./dist/cjs/index.js"
|
|
38
|
-
}
|
|
34
|
+
"types": "./dist/types/index.d.ts",
|
|
35
|
+
"import": "./dist/esm/index.mjs",
|
|
36
|
+
"require": "./dist/cjs/index.cjs"
|
|
39
37
|
},
|
|
40
|
-
"main": "dist/cjs/index.
|
|
41
|
-
"module": "dist/esm/index.
|
|
38
|
+
"main": "dist/cjs/index.mjs",
|
|
39
|
+
"module": "dist/esm/index.mjs",
|
|
42
40
|
"types": "dist/types/index.d.ts",
|
|
43
41
|
"files": [
|
|
44
42
|
"dist/**/*"
|