lodash-omitdeep 1.0.14 → 1.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 siberiacancode
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # lodash-omitdeep
1
+ # ♻️ Lodash Omit Deep
2
2
 
3
3
  > Lodash omitDeep/omitDeepBy object key/value recursively
4
4
 
@@ -6,20 +6,24 @@ lodash-omitdeep allows you to execute lodash omit, omitBy functions recursively.
6
6
 
7
7
  ## Install
8
8
 
9
- Install with [npm](https://www.npmjs.com/)
9
+ Install with [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/)
10
10
 
11
- ```sh
11
+ ```bash
12
12
  $ npm i lodash-omitdeep --save
13
+ # or
14
+ $ yarn add lodash-omitdeep
13
15
  ```
14
16
 
15
- Install with [yarn](https://yarnpkg.com/)
17
+ ## Usage
18
+
19
+ Install **♻️ Lodash Omit Deep** with [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/)
16
20
 
17
- ```sh
21
+ ```bash
22
+ $ npm i lodash-omitdeep --save
23
+ # or
18
24
  $ yarn add lodash-omitdeep
19
25
  ```
20
26
 
21
- ## Usage
22
-
23
27
  ### omitDeep
24
28
 
25
29
  ```js
@@ -43,14 +47,18 @@ omitDeepBy({ a: 2, b: 'b', c: { b: 4, d: { b: 1, f: 'f' } } }, isNumber);
43
47
  //=> {b: "b", c: {d: {f: "f"}}}
44
48
  ```
45
49
 
46
- ## Contributing
47
-
48
- Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/debabin/lodash-omitdeep/issues/new)
49
-
50
- ## Author
51
-
52
- - [github/debabin](https://github.com/debabin)
53
-
54
- ## License
55
-
56
- Released under the MIT license.
50
+ ## ✨ Contributors
51
+
52
+ <table>
53
+ <tr>
54
+ <td align="center" style="word-wrap: break-word; width: 100.0; height: 100.0">
55
+ <a href="https://github.com/debabin">
56
+ <img src="https://avatars.githubusercontent.com/u/45297354?v=4"
57
+ width="100;"
58
+ alt="debabin" />
59
+ <br />
60
+ <sub style="font-size:13px"><b>☄️ debabin</b></sub>
61
+ </a>
62
+ </td>
63
+ </tr>
64
+ </table>
@@ -0,0 +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)}};
2
+ //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,63 +1,101 @@
1
- {
2
- "name": "lodash-omitdeep",
3
- "version": "1.0.14",
4
- "description": "Lodash omitDeep/omitByDeep object key/value recursively",
5
- "main": "lib/index.js",
6
- "types": "lib/index.d.ts",
7
- "keywords": [
8
- "lodash",
9
- "omit",
10
- "omitDeep",
11
- "omitBy",
12
- "omitByDeep",
13
- "key",
14
- "keys",
15
- "delete",
16
- "remove",
17
- "object",
18
- "deep"
19
- ],
20
- "homepage": "https://github.com/debabin/lodash-omitdeep",
21
- "author": "Dmitriy Babin (https://github.com/debabin)",
22
- "repository": {
23
- "type": "git",
24
- "url": "https://github.com/debabin/lodash-omitdeep"
25
- },
26
- "bugs": {
27
- "url": "https://github.com/debabin/lodash-omitdeep/issues"
28
- },
29
- "files": [
30
- "lib/**/*"
31
- ],
32
- "scripts": {
33
- "build": "tsc --project tsconfig.json",
34
- "prepublishOnly": "npm test && npm run lint",
35
- "preversion": "npm run lint",
36
- "version": "npm run format && git add -A src",
37
- "prepare": "npm run build",
38
- "postversion": "git push && git push --tags",
39
- "format": "prettier --write \"src/**/*.ts\"",
40
- "lint": "tslint -p tsconfig.json",
41
- "test": "jest --config jestconfig.json"
42
- },
43
- "license": "ISC",
44
- "devDependencies": {
45
- "@types/jest": "^29.2.3",
46
- "@types/lodash.isnil": "^4.0.7",
47
- "@types/lodash.isplainobject": "^4.0.7",
48
- "@types/lodash.omit": "^4.5.7",
49
- "@types/lodash.omitby": "^4.6.7",
50
- "jest": "^29.2.3",
51
- "prettier": "^2.7.1",
52
- "ts-jest": "^29.0.3",
53
- "tslint": "^6.1.3",
54
- "tslint-config-prettier": "^1.18.0",
55
- "typescript": "^4.9.3"
56
- },
57
- "dependencies": {
58
- "lodash.isnil": "^4.0.0",
59
- "lodash.isplainobject": "^4.0.6",
60
- "lodash.omit": "^4.5.0",
61
- "lodash.omitby": "^4.6.0"
62
- }
63
- }
1
+ {
2
+ "name": "lodash-omitdeep",
3
+ "version": "1.1.0",
4
+ "description": "Lodash omitDeep/omitByDeep object key/value recursively",
5
+ "author": {
6
+ "name": "SIBERIA CAN CODE 🧊",
7
+ "url": "https://github.com/siberiacancode"
8
+ },
9
+ "contributors": [
10
+ {
11
+ "name": "Dmitry Babin",
12
+ "url": "https://github.com/debabin"
13
+ }
14
+ ],
15
+ "license": "MIT",
16
+ "main": "dist/cjs/index.js",
17
+ "module": "dist/esm/index.js",
18
+ "types": "dist/index.d.ts",
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
+ "homepage": "https://github.com/siberiacancode/lodash-omitdeep",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "https://github.com/siberiacancode/lodash-omitdeep"
36
+ },
37
+ "bugs": {
38
+ "url": "https://github.com/siberiacancode/lodash-omitdeep/issues"
39
+ },
40
+ "files": [
41
+ "lib/**/*"
42
+ ],
43
+ "scripts": {
44
+ "build": "rollup -c --bundleConfigAsCjs",
45
+ "prepublishOnly": "npm test && npm run lint",
46
+ "preversion": "npm run lint",
47
+ "version": "npm run format && git add -A src",
48
+ "prepare": "husky install && npm run build",
49
+ "postversion": "git push && git push --tags",
50
+ "lint": "eslint . --ext ts --ext tsx --no-error-on-unmatched-pattern",
51
+ "format": "prettier --write src/**/*.{ts,tsx}",
52
+ "type": "tsc --noEmit",
53
+ "pretty": "yarn type && yarn format && yarn lint --fix",
54
+ "test": "jest --config jestconfig.json"
55
+ },
56
+ "lint-staged": {
57
+ "*.js": "yarn format",
58
+ "*.ts": "yarn pretty"
59
+ },
60
+ "peerDependencies": {
61
+ "lodash.isnil": "*",
62
+ "lodash.isplainobject": "*",
63
+ "lodash.omit": "*",
64
+ "lodash.omitby": "*"
65
+ },
66
+ "dependencies": {
67
+ "lodash.isnil": "^4.0.0",
68
+ "lodash.isplainobject": "^4.0.6",
69
+ "lodash.omit": "^4.5.0",
70
+ "lodash.omitby": "^4.6.0"
71
+ },
72
+ "devDependencies": {
73
+ "@rollup/plugin-commonjs": "^25.0.0",
74
+ "@rollup/plugin-node-resolve": "^15.1.0",
75
+ "@rollup/plugin-terser": "^0.4.3",
76
+ "@rollup/plugin-typescript": "^11.1.1",
77
+ "@types/jest": "^29.5.1",
78
+ "@types/lodash.isnil": "^4.0.7",
79
+ "@types/lodash.isplainobject": "^4.0.7",
80
+ "@types/lodash.omit": "^4.5.7",
81
+ "@types/lodash.omitby": "^4.6.7",
82
+ "@typescript-eslint/eslint-plugin": "^5.59.9",
83
+ "@typescript-eslint/parser": "^5.59.9",
84
+ "eslint": "^8.42.0",
85
+ "eslint-config-airbnb": "^19.0.4",
86
+ "eslint-config-airbnb-typescript": "^17.0.0",
87
+ "eslint-config-prettier": "^8.7.0",
88
+ "eslint-import-resolver-typescript": "^3.5.5",
89
+ "eslint-plugin-import": "^2.27.5",
90
+ "eslint-plugin-prettier": "^4.2.1",
91
+ "husky": "^8.0.1",
92
+ "jest": "^29.5.0",
93
+ "lint-staged": "^13.2.2",
94
+ "prettier": "^2.8.8",
95
+ "rollup": "^3.24.0",
96
+ "rollup-plugin-dts": "^5.3.0",
97
+ "rollup-plugin-terser": "^7.0.2",
98
+ "ts-jest": "^29.1.0",
99
+ "typescript": "^5.1.3"
100
+ }
101
+ }
package/lib/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import omitDeep from './omitDeep/omitDeep';
2
- import omitByDeep from './omitDeepBy/omitDeepBy';
3
- declare const _default: {
4
- omitDeep: typeof omitDeep;
5
- omitByDeep: typeof omitByDeep;
6
- };
7
- export = _default;
package/lib/index.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- const omitDeep_1 = __importDefault(require("./omitDeep/omitDeep"));
6
- const omitDeepBy_1 = __importDefault(require("./omitDeepBy/omitDeepBy"));
7
- module.exports = { omitDeep: omitDeep_1.default, omitByDeep: omitDeepBy_1.default };
@@ -1,21 +0,0 @@
1
- import type { Many, PropertyName, PartialObject } from 'lodash';
2
- /**
3
- * The opposite of `_.pick`; this method creates an object composed of the
4
- * own and inherited enumerable properties of `object` that are not omitted.
5
- *
6
- * @category Function
7
- * @param object The source object.
8
- * @param [paths] The property names to omit, specified
9
- * individually or in arrays..
10
- * @returns Returns the new object.
11
- * @example
12
- *
13
- * const object = { 'a': 1, 'b': 2, 'c': { 'a': 1, 'b': 2 } };
14
- *
15
- * omitDeep(object, ['b', 'a']);
16
- * // => { 'c': {} }
17
- */
18
- declare function omitDeep<T extends object, K extends PropertyName[]>(object: T | null | undefined, ...paths: K): Pick<T, Exclude<keyof T, K[number]>>;
19
- declare function omitDeep<T extends object, K extends keyof T>(object: T | null | undefined, ...paths: Many<K>[]): Omit<T, K>;
20
- declare function omitDeep<T extends object>(object: T | null | undefined, ...paths: Many<PropertyName>[]): PartialObject<T>;
21
- export default omitDeep;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const lodash_omit_1 = __importDefault(require("lodash.omit"));
7
- const lodash_isplainobject_1 = __importDefault(require("lodash.isplainobject"));
8
- const lodash_isnil_1 = __importDefault(require("lodash.isnil"));
9
- function omitDeep(object, ...paths) {
10
- function omitDeepOnOwnProps(object) {
11
- if (!Array.isArray(object) && !(0, lodash_isplainobject_1.default)(object)) {
12
- return object;
13
- }
14
- if (Array.isArray(object)) {
15
- return object.map((element) => (needOmit(element) ? omitDeep(element, ...paths) : element));
16
- }
17
- const temp = {};
18
- for (const [key, value] of Object.entries(object)) {
19
- temp[key] = needOmit(value) ? omitDeep(value, ...paths) : value;
20
- }
21
- return (0, lodash_omit_1.default)(temp, ...paths);
22
- }
23
- return omitDeepOnOwnProps(object);
24
- }
25
- function needOmit(value) {
26
- return !(0, lodash_isnil_1.default)(value) && ((0, lodash_isplainobject_1.default)(value) || Array.isArray(value));
27
- }
28
- exports.default = omitDeep;
@@ -1,21 +0,0 @@
1
- import type { PartialObject, ValueKeyIteratee, NumericDictionary, Dictionary } from 'lodash';
2
- /**
3
- * The opposite of `_.pickBy`; this method creates an object composed of the
4
- * own and inherited enumerable properties of `object` that `predicate`
5
- * doesn't return truthy for.
6
- *
7
- * @category Function
8
- * @param object The source object.
9
- * @param [predicate=_.identity] The function invoked per property.
10
- * @returns Returns the new object.
11
- * @example
12
- *
13
- * const object = { 'a': 1, 'b': null, 'c': { 'a': 1, 'b': null } };
14
- *
15
- * omitByDeep(object, _.isNil);
16
- * // => { 'a': 1, 'c': { 'a': 1 } }
17
- */
18
- declare function omitByDeep<T>(object: Dictionary<T> | null | undefined, predicate?: ValueKeyIteratee<T>): Dictionary<T>;
19
- declare function omitByDeep<T>(object: NumericDictionary<T> | null | undefined, predicate?: ValueKeyIteratee<T>): NumericDictionary<T>;
20
- declare function omitByDeep<T extends object>(object: T | null | undefined, predicate: ValueKeyIteratee<T[keyof T]>): PartialObject<T>;
21
- export default omitByDeep;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const lodash_omitby_1 = __importDefault(require("lodash.omitby"));
7
- const lodash_isplainobject_1 = __importDefault(require("lodash.isplainobject"));
8
- function omitByDeep(object, cb) {
9
- function omitByDeepByOnOwnProps(object) {
10
- if (!Array.isArray(object) && !(0, lodash_isplainobject_1.default)(object)) {
11
- return object;
12
- }
13
- if (Array.isArray(object)) {
14
- return object.map((element) => omitByDeep(element, cb));
15
- }
16
- const temp = {};
17
- for (const [key, value] of Object.entries(object)) {
18
- temp[key] = omitByDeep(value, cb);
19
- }
20
- return (0, lodash_omitby_1.default)(temp, cb);
21
- }
22
- return omitByDeepByOnOwnProps(object);
23
- }
24
- exports.default = omitByDeep;