classifier.js
Version:
:robot: Natural language processing with Javascript
17 lines (16 loc) • 556 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.returnTypeParser = exports.isArray = void 0;
const parser_1 = require("./parser");
exports.isArray = Array.isArray;
const returnTypeParser = (value, options) => {
switch (options === null || options === void 0 ? void 0 : options.returnType) {
case 'NUMBER':
return value;
case 'PERCENTAGE':
return (0, parser_1.toPercent)(value);
default:
return value;
}
};
exports.returnTypeParser = returnTypeParser;