UNPKG

dynamodb-toolbox

Version:

Lightweight and type-safe query builder for DynamoDB and TypeScript.

36 lines (35 loc) 1.35 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getFormattedValueJSONSchema = void 0; 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 getFormattedValueJSONSchema = (schema) => { switch (schema.type) { case 'any': return {}; case 'null': case 'boolean': case 'number': case 'string': case 'binary': return (0, primitive_js_1.getFormattedPrimitiveJSONSchema)(schema); case 'set': return (0, set_js_1.getFormattedSetJSONSchema)(schema); case 'list': return (0, list_js_1.getFormattedListJSONSchema)(schema); case 'map': return (0, map_js_1.getFormattedMapJSONSchema)(schema); case 'record': return (0, record_js_1.getFormattedRecordJSONSchema)(schema); case 'anyOf': return (0, anyOf_js_1.getFormattedAnyOfJSONSchema)(schema); case 'item': return (0, item_js_1.getFormattedItemJSONSchema)(schema); } }; exports.getFormattedValueJSONSchema = getFormattedValueJSONSchema;