UNPKG

tynder

Version:

TypeScript friendly Data validator for JavaScript.

46 lines 1.28 kB
"use strict"; // Copyright (c) 2020 Shellyl_N and Authors // license: ISC // https://github.com/shellyln Object.defineProperty(exports, "__esModule", { value: true }); exports.noopStereotype = void 0; exports.noopStereotype = { tryParse: (value) => { return ({ value }); }, evaluateFormula: (valueOrFormula) => { return valueOrFormula; }, compare: (a, b) => { // NOTE: You should pass assertion value (schema value) into 'a'. const tyA = typeof a; const tyB = typeof b; if (tyA !== tyB) { return NaN; } switch (tyA) { case 'number': if (Number.isNaN(a) && Number.isNaN(b)) { return 0; } else { return a - b; } default: if (a === b) { return 0; } else if (a > b) { return 1; } else if (a < b) { return -1; } else { return NaN; } } }, doCast: false, }; //# sourceMappingURL=noop.js.map