dynamodb-toolbox
Version:
Lightweight and type-safe query builder for DynamoDB and TypeScript.
37 lines (36 loc) • 1.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromSchemaDTO = void 0;
const any_js_1 = require("./any.js");
const anyOf_js_1 = require("./anyOf.js");
const item_js_1 = require("./item.js");
const list_js_1 = require("./list.js");
const map_js_1 = require("./map.js");
const primitive_js_1 = require("./primitive.js");
const record_js_1 = require("./record.js");
const set_js_1 = require("./set.js");
const fromSchemaDTO = (schemaDTO) => {
switch (schemaDTO.type) {
case 'any':
return (0, any_js_1.fromAnySchemaDTO)(schemaDTO);
case 'null':
case 'boolean':
case 'number':
case 'string':
case 'binary':
return (0, primitive_js_1.fromPrimitiveSchemaDTO)(schemaDTO);
case 'set':
return (0, set_js_1.fromSetSchemaDTO)(schemaDTO);
case 'list':
return (0, list_js_1.fromListSchemaDTO)(schemaDTO);
case 'map':
return (0, map_js_1.fromMapSchemaDTO)(schemaDTO);
case 'record':
return (0, record_js_1.fromRecordSchemaDTO)(schemaDTO);
case 'anyOf':
return (0, anyOf_js_1.fromAnyOfSchemaDTO)(schemaDTO);
case 'item':
return (0, item_js_1.fromItemSchemaDTO)(schemaDTO);
}
};
exports.fromSchemaDTO = fromSchemaDTO;