@intelligo.ai/object-to-schema
Advanced tools
Comparing version 1.4.4 to 1.4.5
@@ -9,3 +9,4 @@ import { Transform, SomeObj, TreeLeaf } from './types'; | ||
export declare function sortTransformsByPriority(transforms: Transform[]): Transform[]; | ||
export declare function pruneObject(obj: SomeObj): SomeObj; | ||
export declare function pruneEmpty<T extends SomeObj>(obj: T): any; | ||
//# sourceMappingURL=transform.d.ts.map |
@@ -78,2 +78,18 @@ "use strict"; | ||
exports.sortTransformsByPriority = sortTransformsByPriority; | ||
function pruneObject(obj) { | ||
var entries = Object | ||
.entries(obj) | ||
.map(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
return ramda_1.default.isEmpty(value) | ||
? [key, undefined] | ||
: [key, pruneObject(value)]; | ||
}) | ||
.filter(function (_a) { | ||
var _ = _a[0], value = _a[1]; | ||
return !value; | ||
}); | ||
return Object.entries(entries); | ||
} | ||
exports.pruneObject = pruneObject; | ||
function pruneEmpty(obj) { | ||
@@ -80,0 +96,0 @@ return function prune(current) { |
{ | ||
"name": "@intelligo.ai/object-to-schema", | ||
"version": "1.4.4", | ||
"version": "1.4.5", | ||
"description": "", | ||
@@ -17,7 +17,7 @@ "main": "dist/index.js", | ||
"jest": "^24.9.0", | ||
"ts-jest": "^24.1.0", | ||
"typescript": "^3.7.2" | ||
"ts-jest": "^24.1.0" | ||
}, | ||
"dependencies": { | ||
"@types/node": "^13.9.8", | ||
"lodash": "^4.17.15", | ||
"object-path": "^0.11.4", | ||
@@ -24,0 +24,0 @@ "ramda": "^0.26.1" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
321576
5
6260
4
+ Addedlodash@^4.17.15
+ Addedlodash@4.17.21(transitive)