@intelligo.ai/object-to-schema
Advanced tools
Comparing version 2.3.4 to 2.3.5
@@ -15,2 +15,3 @@ declare function fromTracerDate(tracerDate: number): string | undefined; | ||
declare function convertFastCaseData(fastCaseDate: string): Promise<Date | undefined>; | ||
declare function convertClearData(clearDate: string): Date | null | undefined; | ||
export declare const strategies: { | ||
@@ -38,2 +39,3 @@ predefinedTransformations: { | ||
convertFastCaseData: typeof convertFastCaseData; | ||
convertClearData: typeof convertClearData; | ||
}; | ||
@@ -40,0 +42,0 @@ }; |
@@ -72,2 +72,18 @@ "use strict"; | ||
}; | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -335,2 +351,19 @@ exports.strategies = void 0; | ||
} | ||
function convertClearData(clearDate) { | ||
if (!clearDate) { | ||
return; | ||
} | ||
if (clearDate.includes(';')) { | ||
var dates = clearDate.split(';'); | ||
if (dates.length === 1) { | ||
return chrono.parseDate(dates[0]); | ||
} | ||
var _a = __read(dates | ||
.map(function (date) { return date.trim(); }) | ||
.map(function (date) { return chrono.parseDate(date); }) | ||
.sort(function (a, b) { return a.getTime() - b.getTime(); }), 1), earlyDate = _a[0]; | ||
return earlyDate; | ||
} | ||
return chrono.parseDate(clearDate); | ||
} | ||
exports.strategies = { | ||
@@ -357,5 +390,6 @@ predefinedTransformations: { | ||
convertStringToDate: function (str) { return chrono.parseDate(str); }, | ||
convertFastCaseData: convertFastCaseData | ||
convertFastCaseData: convertFastCaseData, | ||
convertClearData: convertClearData | ||
} | ||
}; | ||
//# sourceMappingURL=predefinedTransformations.js.map |
{ | ||
"name": "@intelligo.ai/object-to-schema", | ||
"version": "2.3.4", | ||
"version": "2.3.5", | ||
"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
100723
1372