core-mb 1.1.2 → 1.1.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/dist/enum.hr.d.ts +0 -0
- package/dist/enum.hr.js +1 -0
- package/dist/enum.inventory.d.ts +0 -0
- package/dist/enum.inventory.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/object.helper.d.ts +8 -0
- package/dist/object.helper.js +23 -0
- package/package.json +1 -1
- package/src/enum.hr.ts +0 -0
- package/src/enum.inventory.ts +0 -0
- package/src/index.ts +2 -1
- package/src/object.helper.ts +19 -0
|
File without changes
|
package/dist/enum.hr.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -21,3 +21,4 @@ __exportStar(require("./validation.helper"), exports);
|
|
|
21
21
|
__exportStar(require("class-validator"), exports);
|
|
22
22
|
__exportStar(require("./transformer.helper"), exports);
|
|
23
23
|
__exportStar(require("./logging.helper"), exports);
|
|
24
|
+
__exportStar(require("./object.helper"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Omit specified keys from an object
|
|
3
|
+
*/
|
|
4
|
+
export declare function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
|
|
5
|
+
/**
|
|
6
|
+
* Pick only specified keys from an object
|
|
7
|
+
*/
|
|
8
|
+
export declare function pick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.omit = omit;
|
|
4
|
+
exports.pick = pick;
|
|
5
|
+
/**
|
|
6
|
+
* Omit specified keys from an object
|
|
7
|
+
*/
|
|
8
|
+
function omit(obj, keys) {
|
|
9
|
+
const result = { ...obj };
|
|
10
|
+
keys.forEach(k => delete result[k]);
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Pick only specified keys from an object
|
|
15
|
+
*/
|
|
16
|
+
function pick(obj, keys) {
|
|
17
|
+
const result = {};
|
|
18
|
+
keys.forEach(k => {
|
|
19
|
+
if (obj[k] !== undefined)
|
|
20
|
+
result[k] = obj[k];
|
|
21
|
+
});
|
|
22
|
+
return result;
|
|
23
|
+
}
|
package/package.json
CHANGED
package/src/enum.hr.ts
ADDED
|
File without changes
|
|
File without changes
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Omit specified keys from an object
|
|
3
|
+
*/
|
|
4
|
+
export function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {
|
|
5
|
+
const result = { ...obj }
|
|
6
|
+
keys.forEach(k => delete result[k])
|
|
7
|
+
return result
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Pick only specified keys from an object
|
|
12
|
+
*/
|
|
13
|
+
export function pick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {
|
|
14
|
+
const result = {} as Pick<T, K>
|
|
15
|
+
keys.forEach(k => {
|
|
16
|
+
if (obj[k] !== undefined) result[k] = obj[k]
|
|
17
|
+
})
|
|
18
|
+
return result
|
|
19
|
+
}
|