@intelligo.ai/object-to-schema
Advanced tools
Comparing version 2.2.3 to 2.2.4
@@ -9,2 +9,3 @@ declare function fromTracerDate(tracerDate: number): string | undefined; | ||
declare function fieldConditionMapping(value: any, options: any): any; | ||
declare function joinObjectKeysToString(value: any, options: any): string; | ||
export declare const strategies: { | ||
@@ -26,2 +27,3 @@ predefinedTransformations: { | ||
fieldConditionMapping: typeof fieldConditionMapping; | ||
joinObjectKeysToString: typeof joinObjectKeysToString; | ||
}; | ||
@@ -28,0 +30,0 @@ }; |
"use strict"; | ||
var __values = (this && this.__values) || function(o) { | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) return m.call(o); | ||
if (o && typeof o.length === "number") return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -141,2 +152,29 @@ var transform_1 = require("./transform"); | ||
} | ||
function joinObjectKeysToString(value, options) { | ||
var e_1, _a; | ||
var keysToJoin = options.keysToJoin, seperator = options.seperator; | ||
var valueToMap = ''; | ||
try { | ||
for (var keysToJoin_1 = __values(keysToJoin), keysToJoin_1_1 = keysToJoin_1.next(); !keysToJoin_1_1.done; keysToJoin_1_1 = keysToJoin_1.next()) { | ||
var key = keysToJoin_1_1.value; | ||
var valueToCheck = object_path_1.get(value, key); | ||
if (valueToCheck) { | ||
if (seperator) { | ||
valueToMap = valueToMap ? valueToMap + (seperator + " " + valueToCheck) : valueToCheck; | ||
continue; | ||
} | ||
valueToMap = valueToMap ? valueToMap + (" " + valueToCheck) : valueToCheck; | ||
} | ||
valueToMap = valueToMap.trim(); | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (keysToJoin_1_1 && !keysToJoin_1_1.done && (_a = keysToJoin_1.return)) _a.call(keysToJoin_1); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
return valueToMap; | ||
} | ||
exports.strategies = { | ||
@@ -157,5 +195,6 @@ predefinedTransformations: { | ||
arrayObjectKeyToArrayString: arrayObjectKeyToArrayString, | ||
fieldConditionMapping: fieldConditionMapping | ||
fieldConditionMapping: fieldConditionMapping, | ||
joinObjectKeysToString: joinObjectKeysToString | ||
} | ||
}; | ||
//# sourceMappingURL=predefinedTransformations.js.map |
{ | ||
"name": "@intelligo.ai/object-to-schema", | ||
"version": "2.2.3", | ||
"version": "2.2.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
81827
1152
0