remove-anything 2.0.2 → 2.0.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.
package/README.md CHANGED
@@ -9,7 +9,7 @@ npm i remove-anything
9
9
 
10
10
  Removes props (eg. undefined) from an object
11
11
 
12
- An optimised way to remove any prop (eg. `undefined`, empty objects, ...) from an object. A small and simple integration.
12
+ An optimised way to remove any prop value (eg. `undefined`, empty objects, ...) from an object. A small and simple integration.
13
13
 
14
14
  ## Usage
15
15
 
package/dist/index.d.ts CHANGED
@@ -1,20 +1,12 @@
1
- /**
2
- * Recursively remove props from an object, if the prop's value matches `valueToRemove`
3
- */
1
+ /** Recursively remove props from an object, if the prop's value matches `valueToRemove` */
4
2
  export declare function removeProp(payload: {
5
3
  [key in string | number | symbol]: unknown;
6
4
  }, valueToRemove: unknown, ...valuesToRemove: unknown[]): {
7
5
  [key in string | number | symbol]: unknown;
8
6
  };
9
- /**
10
- * @deprecated use `removeProp` instead and pass multiple parameters
11
- */
12
- export declare const removeProps: (payload: {
13
- [x: string]: unknown;
14
- [x: number]: unknown;
15
- [x: symbol]: unknown;
16
- }, valuesToRemove: unknown[]) => {
17
- [x: string]: unknown;
18
- [x: number]: unknown;
19
- [x: symbol]: unknown;
7
+ /** @deprecated Use `removeProp` instead and pass multiple parameters */
8
+ export declare function removeProps(payload: {
9
+ [key in string | number | symbol]: unknown;
10
+ }, valuesToRemove: unknown[]): {
11
+ [key in string | number | symbol]: unknown;
20
12
  };
package/dist/index.js CHANGED
@@ -1,7 +1,5 @@
1
1
  import { isEmptyArray, isEmptyObject, isPlainObject } from 'is-what';
2
- /**
3
- * Recursively remove props from an object, if the prop's value matches `valueToRemove`
4
- */
2
+ /** Recursively remove props from an object, if the prop's value matches `valueToRemove` */
5
3
  export function removeProp(payload, valueToRemove, ...valuesToRemove) {
6
4
  if (!isPlainObject(payload))
7
5
  return payload;
@@ -24,7 +22,7 @@ export function removeProp(payload, valueToRemove, ...valuesToRemove) {
24
22
  return carry;
25
23
  }, {});
26
24
  }
27
- /**
28
- * @deprecated use `removeProp` instead and pass multiple parameters
29
- */
30
- export const removeProps = (payload, valuesToRemove) => removeProp(payload, valuesToRemove[0], ...valuesToRemove);
25
+ /** @deprecated Use `removeProp` instead and pass multiple parameters */
26
+ export function removeProps(payload, valuesToRemove) {
27
+ return removeProp(payload, valuesToRemove[0], ...valuesToRemove);
28
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remove-anything",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "Remove any prop (eg. `undefined`) from an object",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -17,14 +17,14 @@
17
17
  "release": "npm run lint && npm run build && np"
18
18
  },
19
19
  "dependencies": {
20
- "is-what": "^5.0.1"
20
+ "is-what": "^5.2.0"
21
21
  },
22
22
  "devDependencies": {
23
- "del-cli": "^5.1.0",
24
- "np": "^10.0.5",
25
- "vitest": "^1.6.0",
26
- "@cycraft/eslint": "^0.3.0",
27
- "@cycraft/tsconfig": "^0.1.2"
23
+ "@cycraft/eslint": "^0.4.3",
24
+ "@cycraft/tsconfig": "^0.1.2",
25
+ "del-cli": "^6.0.0",
26
+ "np": "^10.2.0",
27
+ "vitest": "^3.0.6"
28
28
  },
29
29
  "files": [
30
30
  "dist"