@intelligo.ai/object-to-schema
Advanced tools
Comparing version 1.4.5 to 1.5.0
@@ -53,2 +53,3 @@ "use strict"; | ||
} | ||
transform_1.applyToAll(); | ||
var strategies = { | ||
@@ -55,0 +56,0 @@ predefinedTransformations: { |
import { Transform, SomeObj, TreeLeaf } from './types'; | ||
export declare function generateTransform(transforms: Transform[]): Iterator<Transform>; | ||
export declare function applyToAll<P, A>(fn: (oneOrMany: P) => A): (oneOrMany: P | P[]) => A | A[]; | ||
export declare function assignSchema(schema: SomeObj, key: string, value: any): SomeObj & { | ||
@@ -4,0 +5,0 @@ [x: string]: any; |
@@ -57,2 +57,10 @@ "use strict"; | ||
exports.generateTransform = generateTransform; | ||
function applyToAll(fn) { | ||
return function withFunction(oneOrMany) { | ||
return Array.isArray(oneOrMany) | ||
? oneOrMany.map(fn) | ||
: fn(oneOrMany); | ||
}; | ||
} | ||
exports.applyToAll = applyToAll; | ||
function assignSchema(schema, key, value) { | ||
@@ -59,0 +67,0 @@ var _a; |
{ | ||
"name": "@intelligo.ai/object-to-schema", | ||
"version": "1.4.5", | ||
"version": "1.5.0", | ||
"description": "", | ||
@@ -17,3 +17,4 @@ "main": "dist/index.js", | ||
"jest": "^24.9.0", | ||
"ts-jest": "^24.1.0" | ||
"ts-jest": "^25.3.0", | ||
"typescript": "^3.8.3" | ||
}, | ||
@@ -20,0 +21,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
51
59988
6
778
1