lodash-omitdeep 1.1.0 → 1.1.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.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var r=require("lodash.isnil"),e=require("lodash.isplainobject"),t=require("lodash.omit"),i=require("lodash.omitby");function n(t){return!r(t)&&(e(t)||Array.isArray(t))}exports={omitDeep:function r(i,...o){return function(i){if(!Array.isArray(i)&&!e(i))return i;if(Array.isArray(i))return i.map((e=>n(e)?r(e,...o):e));const s={};for(const[e,t]of Object.entries(i))s[e]=n(t)?r(t,...o):t;return t(s,...o)}(i)},omitByDeep:function r(t,n){return function(t){if(!Array.isArray(t)&&!e(t))return t;if(Array.isArray(t))return t.map((e=>r(e,n)));const o={};for(const[e,i]of Object.entries(t))o[e]=r(i,n);return i(o,n)}(t)}};
1
+ "use strict";var r=require("lodash.isnil"),e=require("lodash.isplainobject"),t=require("lodash.omit"),i=require("lodash.omitby");function n(t){return!r(t)&&(e(t)||Array.isArray(t))}var o={omitDeep:function r(i,...o){return function(i){if(!Array.isArray(i)&&!e(i))return i;if(Array.isArray(i))return i.map((e=>n(e)?r(e,...o):e));const s={};for(const[e,t]of Object.entries(i))s[e]=n(t)?r(t,...o):t;return t(s,...o)}(i)},omitByDeep:function r(t,n){return function(t){if(!Array.isArray(t)&&!e(t))return t;if(Array.isArray(t))return t.map((e=>r(e,n)));const o={};for(const[e,i]of Object.entries(t))o[e]=r(i,n);return i(o,n)}(t)}};module.exports=o;
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/omitDeep/omitDeep.ts","../../src/index.ts","../../src/omitDeepBy/omitDeepBy.ts"],"sourcesContent":[null,null,null],"names":["needOmit","value","isNil","isPlainObject","Array","isArray","index","omitDeep","object","paths","map","element","temp","key","Object","entries","omit","omitDeepOnOwnProps","omitByDeep","cb","omitBy","omitByDeepByOnOwnProps"],"mappings":"iIAKA,SAASA,EAASC,GAChB,OAAQC,EAAMD,KAAWE,EAAcF,IAAUG,MAAMC,QAAQJ,GACjE,CCJA,IAAAK,EAAe,CAAEC,SDmCjB,SAASA,EAASC,KAAgBC,GAoBhC,OAnBA,SAA4BD,GAC1B,IAAKJ,MAAMC,QAAQG,KAAYL,EAAcK,GAC3C,OAAOA,EAGT,GAAIJ,MAAMC,QAAQG,GAChB,OAAOA,EAAOE,KAAKC,GAAaX,EAASW,GAAWJ,EAASI,KAAYF,GAASE,IAGpF,MAAMC,EAAO,CAAA,EAEb,IAAK,MAAOC,EAAKZ,KAAUa,OAAOC,QAE/BP,GACAI,EAAaC,GAAOb,EAASC,GAASM,EAASN,KAAUQ,GAASR,EAErE,OAAOe,EAAKJ,KAASH,EACtB,CAEMQ,CAAmBT,EAC5B,ECxD2BU,WCqC3B,SAASA,EAAWV,EAAaW,GAoB/B,OAnBA,SAAgCX,GAC9B,IAAKJ,MAAMC,QAAQG,KAAYL,EAAcK,GAC3C,OAAOA,EAGT,GAAIJ,MAAMC,QAAQG,GAChB,OAAOA,EAAOE,KAAKC,GAAYO,EAAWP,EAASQ,KAGrD,MAAMP,EAAO,CAAA,EAEb,IAAK,MAAOC,EAAKZ,KAAUa,OAAOC,QAE/BP,GACAI,EAAaC,GAAOK,EAAWjB,EAAOkB,GAEzC,OAAOC,EAAOR,EAAMO,EACrB,CAEME,CAAuBb,EAChC"}
@@ -0,0 +1,2 @@
1
+ import r from"lodash.isnil";import t from"lodash.isplainobject";import o from"lodash.omit";import i from"lodash.omitby";function n(o){return!r(o)&&(t(o)||Array.isArray(o))}var e={omitDeep:function r(i,...e){return function(i){if(!Array.isArray(i)&&!t(i))return i;if(Array.isArray(i))return i.map((t=>n(t)?r(t,...e):t));const a={};for(const[t,o]of Object.entries(i))a[t]=n(o)?r(o,...e):o;return o(a,...e)}(i)},omitByDeep:function r(o,n){return function(o){if(!Array.isArray(o)&&!t(o))return o;if(Array.isArray(o))return o.map((t=>r(t,n)));const e={};for(const[t,i]of Object.entries(o))e[t]=r(i,n);return i(e,n)}(o)}};export{e as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/omitDeep/omitDeep.ts","../../src/index.ts","../../src/omitDeepBy/omitDeepBy.ts"],"sourcesContent":[null,null,null],"names":["needOmit","value","isNil","isPlainObject","Array","isArray","index","omitDeep","object","paths","map","element","temp","key","Object","entries","omit","omitDeepOnOwnProps","omitByDeep","cb","omitBy","omitByDeepByOnOwnProps"],"mappings":"wHAKA,SAASA,EAASC,GAChB,OAAQC,EAAMD,KAAWE,EAAcF,IAAUG,MAAMC,QAAQJ,GACjE,CCJA,IAAAK,EAAe,CAAEC,SDmCjB,SAASA,EAASC,KAAgBC,GAoBhC,OAnBA,SAA4BD,GAC1B,IAAKJ,MAAMC,QAAQG,KAAYL,EAAcK,GAC3C,OAAOA,EAGT,GAAIJ,MAAMC,QAAQG,GAChB,OAAOA,EAAOE,KAAKC,GAAaX,EAASW,GAAWJ,EAASI,KAAYF,GAASE,IAGpF,MAAMC,EAAO,CAAA,EAEb,IAAK,MAAOC,EAAKZ,KAAUa,OAAOC,QAE/BP,GACAI,EAAaC,GAAOb,EAASC,GAASM,EAASN,KAAUQ,GAASR,EAErE,OAAOe,EAAKJ,KAASH,EACtB,CAEMQ,CAAmBT,EAC5B,ECxD2BU,WCqC3B,SAASA,EAAWV,EAAaW,GAoB/B,OAnBA,SAAgCX,GAC9B,IAAKJ,MAAMC,QAAQG,KAAYL,EAAcK,GAC3C,OAAOA,EAGT,GAAIJ,MAAMC,QAAQG,GAChB,OAAOA,EAAOE,KAAKC,GAAYO,EAAWP,EAASQ,KAGrD,MAAMP,EAAO,CAAA,EAEb,IAAK,MAAOC,EAAKZ,KAAUa,OAAOC,QAE/BP,GACAI,EAAaC,GAAOK,EAAWjB,EAAOkB,GAEzC,OAAOC,EAAOR,EAAMO,EACrB,CAEME,CAAuBb,EAChC"}
@@ -0,0 +1,48 @@
1
+ import { PropertyName, Many, PartialObject, Dictionary, ValueKeyIteratee, NumericDictionary } from 'lodash';
2
+
3
+ /**
4
+ * The opposite of `_.pick`; this method creates an object composed of the
5
+ * own and inherited enumerable properties of `object` that are not omitted.
6
+ *
7
+ * @category Function
8
+ * @param object The source object.
9
+ * @param [paths] The property names to omit, specified
10
+ * individually or in arrays..
11
+ * @returns Returns the new object.
12
+ * @example
13
+ *
14
+ * const object = { 'a': 1, 'b': 2, 'c': { 'a': 1, 'b': 2 } };
15
+ *
16
+ * omitDeep(object, ['b', 'a']);
17
+ * // => { 'c': {} }
18
+ */
19
+ declare function omitDeep<T extends object, K extends PropertyName[]>(object: T | null | undefined, ...paths: K): Pick<T, Exclude<keyof T, K[number]>>;
20
+ declare function omitDeep<T extends object, K extends keyof T>(object: T | null | undefined, ...paths: Many<K>[]): Omit<T, K>;
21
+ declare function omitDeep<T extends object>(object: T | null | undefined, ...paths: Many<PropertyName>[]): PartialObject<T>;
22
+
23
+ /**
24
+ * The opposite of `_.pickBy`; this method creates an object composed of the
25
+ * own and inherited enumerable properties of `object` that `predicate`
26
+ * doesn't return truthy for.
27
+ *
28
+ * @category Function
29
+ * @param object The source object.
30
+ * @param [predicate=_.identity] The function invoked per property.
31
+ * @returns Returns the new object.
32
+ * @example
33
+ *
34
+ * const object = { 'a': 1, 'b': null, 'c': { 'a': 1, 'b': null } };
35
+ *
36
+ * omitByDeep(object, _.isNil);
37
+ * // => { 'a': 1, 'c': { 'a': 1 } }
38
+ */
39
+ declare function omitByDeep<T>(object: Dictionary<T> | null | undefined, predicate?: ValueKeyIteratee<T>): Dictionary<T>;
40
+ declare function omitByDeep<T>(object: NumericDictionary<T> | null | undefined, predicate?: ValueKeyIteratee<T>): NumericDictionary<T>;
41
+ declare function omitByDeep<T extends object>(object: T | null | undefined, predicate: ValueKeyIteratee<T[keyof T]>): PartialObject<T>;
42
+
43
+ declare const _default: {
44
+ omitDeep: typeof omitDeep;
45
+ omitByDeep: typeof omitByDeep;
46
+ };
47
+
48
+ export { _default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lodash-omitdeep",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Lodash omitDeep/omitByDeep object key/value recursively",
5
5
  "author": {
6
6
  "name": "SIBERIA CAN CODE 🧊",
@@ -38,10 +38,10 @@
38
38
  "url": "https://github.com/siberiacancode/lodash-omitdeep/issues"
39
39
  },
40
40
  "files": [
41
- "lib/**/*"
41
+ "dist/**/*"
42
42
  ],
43
43
  "scripts": {
44
- "build": "rollup -c --bundleConfigAsCjs",
44
+ "build": "shx rm -rf dist && rollup -c --bundleConfigAsCjs",
45
45
  "prepublishOnly": "npm test && npm run lint",
46
46
  "preversion": "npm run lint",
47
47
  "version": "npm run format && git add -A src",
@@ -94,7 +94,7 @@
94
94
  "prettier": "^2.8.8",
95
95
  "rollup": "^3.24.0",
96
96
  "rollup-plugin-dts": "^5.3.0",
97
- "rollup-plugin-terser": "^7.0.2",
97
+ "shx": "^0.3.4",
98
98
  "ts-jest": "^29.1.0",
99
99
  "typescript": "^5.1.3"
100
100
  }