@visulima/object 1.0.10 → 1.0.11

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.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Modified copy of https://github.com/mesqueeb/filter-anything/blob/main/src/index.ts
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2018 Luca Ban - Mesqueeb
7
+ */
8
+ import type { OmitDeep, Paths } from "type-fest";
9
+ /**
10
+ * omit returns a new object without the props you omit
11
+ *
12
+ * @export
13
+ * @template T
14
+ * @template K
15
+ * @param {T} object the target object to omit props from
16
+ * @param {K[]} keys the prop names you want to omit
17
+ * @returns {OmitDeep<T, K>} a new object without the omitted props
18
+ */
19
+ declare const omit: <T extends { [key in string]: unknown; }, K extends string>(object: T, keys: Paths<T>[]) => OmitDeep<T, K>;
20
+ export = omit;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Modified copy of https://github.com/mesqueeb/filter-anything/blob/main/src/index.ts
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2018 Luca Ban - Mesqueeb
7
+ */
8
+ import type { OmitDeep, Paths } from "type-fest";
9
+ /**
10
+ * omit returns a new object without the props you omit
11
+ *
12
+ * @export
13
+ * @template T
14
+ * @template K
15
+ * @param {T} object the target object to omit props from
16
+ * @param {K[]} keys the prop names you want to omit
17
+ * @returns {OmitDeep<T, K>} a new object without the omitted props
18
+ */
19
+ declare const omit: <T extends { [key in string]: unknown; }, K extends string>(object: T, keys: Paths<T>[]) => OmitDeep<T, K>;
20
+ export default omit;
package/dist/omit.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Modified copy of https://github.com/mesqueeb/filter-anything/blob/main/src/index.ts
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2018 Luca Ban - Mesqueeb
7
+ */
8
+ import type { OmitDeep, Paths } from "type-fest";
9
+ /**
10
+ * omit returns a new object without the props you omit
11
+ *
12
+ * @export
13
+ * @template T
14
+ * @template K
15
+ * @param {T} object the target object to omit props from
16
+ * @param {K[]} keys the prop names you want to omit
17
+ * @returns {OmitDeep<T, K>} a new object without the omitted props
18
+ */
19
+ declare const omit: <T extends { [key in string]: unknown; }, K extends string>(object: T, keys: Paths<T>[]) => OmitDeep<T, K>;
20
+ export = omit;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Modified copy of https://github.com/mesqueeb/filter-anything/blob/main/src/index.ts
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2018 Luca Ban - Mesqueeb
7
+ */
8
+ import type { Paths, PickDeep } from "type-fest";
9
+ /**
10
+ * pick returns a new object with only the props you pick
11
+ *
12
+ * @export
13
+ * @template T
14
+ * @template K
15
+ * @param {T} object the target object to pick props from
16
+ * @param {K[]} keys an array of prop names you want to keep - allows dot-notation for nested props, eg. `nested.prop` will keep just `{ nested: { prop: 1 } }`
17
+ * @returns {PickDeep<T, K>} a new object with just the picked props
18
+ */
19
+ declare const pick: <T extends { [key in string]: unknown; }, K extends Paths<T>>(object: T, keys: Paths<T>[]) => PickDeep<T, K>;
20
+ export = pick;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Modified copy of https://github.com/mesqueeb/filter-anything/blob/main/src/index.ts
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2018 Luca Ban - Mesqueeb
7
+ */
8
+ import type { Paths, PickDeep } from "type-fest";
9
+ /**
10
+ * pick returns a new object with only the props you pick
11
+ *
12
+ * @export
13
+ * @template T
14
+ * @template K
15
+ * @param {T} object the target object to pick props from
16
+ * @param {K[]} keys an array of prop names you want to keep - allows dot-notation for nested props, eg. `nested.prop` will keep just `{ nested: { prop: 1 } }`
17
+ * @returns {PickDeep<T, K>} a new object with just the picked props
18
+ */
19
+ declare const pick: <T extends { [key in string]: unknown; }, K extends Paths<T>>(object: T, keys: Paths<T>[]) => PickDeep<T, K>;
20
+ export default pick;
package/dist/pick.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Modified copy of https://github.com/mesqueeb/filter-anything/blob/main/src/index.ts
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2018 Luca Ban - Mesqueeb
7
+ */
8
+ import type { Paths, PickDeep } from "type-fest";
9
+ /**
10
+ * pick returns a new object with only the props you pick
11
+ *
12
+ * @export
13
+ * @template T
14
+ * @template K
15
+ * @param {T} object the target object to pick props from
16
+ * @param {K[]} keys an array of prop names you want to keep - allows dot-notation for nested props, eg. `nested.prop` will keep just `{ nested: { prop: 1 } }`
17
+ * @returns {PickDeep<T, K>} a new object with just the picked props
18
+ */
19
+ declare const pick: <T extends { [key in string]: unknown; }, K extends Paths<T>>(object: T, keys: Paths<T>[]) => PickDeep<T, K>;
20
+ export = pick;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Modified copy of https://github.com/mesqueeb/filter-anything/blob/main/src/pathsAreEqual.ts
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2018 Luca Ban - Mesqueeb
7
+ */
8
+ declare const pathsAreEqual: (path: string, wildcardPath: string) => boolean;
9
+ export = pathsAreEqual;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Modified copy of https://github.com/mesqueeb/filter-anything/blob/main/src/pathsAreEqual.ts
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2018 Luca Ban - Mesqueeb
7
+ */
8
+ declare const pathsAreEqual: (path: string, wildcardPath: string) => boolean;
9
+ export default pathsAreEqual;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Modified copy of https://github.com/mesqueeb/filter-anything/blob/main/src/pathsAreEqual.ts
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2018 Luca Ban - Mesqueeb
7
+ */
8
+ declare const pathsAreEqual: (path: string, wildcardPath: string) => boolean;
9
+ export = pathsAreEqual;
@@ -0,0 +1,3 @@
1
+ import type { Paths } from "type-fest";
2
+ declare const recursiveOmit: <T extends { [key in string]: unknown; }, OmittedKeys extends Paths<T>[]>(object: T, omittedKeys: OmittedKeys, pathUntilNow?: string) => T;
3
+ export = recursiveOmit;
@@ -0,0 +1,3 @@
1
+ import type { Paths } from "type-fest";
2
+ declare const recursiveOmit: <T extends { [key in string]: unknown; }, OmittedKeys extends Paths<T>[]>(object: T, omittedKeys: OmittedKeys, pathUntilNow?: string) => T;
3
+ export default recursiveOmit;
@@ -0,0 +1,3 @@
1
+ import type { Paths } from "type-fest";
2
+ declare const recursiveOmit: <T extends { [key in string]: unknown; }, OmittedKeys extends Paths<T>[]>(object: T, omittedKeys: OmittedKeys, pathUntilNow?: string) => T;
3
+ export = recursiveOmit;
@@ -0,0 +1,3 @@
1
+ import type { Paths } from "type-fest";
2
+ declare const recursivePick: <T extends { [key in string]: unknown; }, PickedKeys extends Paths<T>[]>(object: T, pickedKeys: PickedKeys, pathUntilNow?: string) => T;
3
+ export = recursivePick;
@@ -0,0 +1,3 @@
1
+ import type { Paths } from "type-fest";
2
+ declare const recursivePick: <T extends { [key in string]: unknown; }, PickedKeys extends Paths<T>[]>(object: T, pickedKeys: PickedKeys, pathUntilNow?: string) => T;
3
+ export default recursivePick;
@@ -0,0 +1,3 @@
1
+ import type { Paths } from "type-fest";
2
+ declare const recursivePick: <T extends { [key in string]: unknown; }, PickedKeys extends Paths<T>[]>(object: T, pickedKeys: PickedKeys, pathUntilNow?: string) => T;
3
+ export = recursivePick;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/object",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Helper functions for working with objects and arrays.",
5
5
  "keywords": [
6
6
  "visulima",