"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.Format = void 0;
const typebox_1 = require("@sinclair/typebox");
const core_1 = require("../../core");
const noAdditionalProps = { additionalProperties: false };
/**
 * Format for encoding as json.
 *
 * For consistency all lists are sorted and undefined values are omitted.
 *
 * This chooses to use lists of named objects instead of maps:
 * this choice is somewhat arbitrary, but avoids user data being used as object keys,
 * which can sometimes be an issue (for example handling that for "__proto__" can require care).
 * It also makes it simpler to determinately sort by keys.
 */
exports.Format = typebox_1.Type.Object({
    version: typebox_1.Type.Literal(core_1.schemaFormat.version),
    nodes: typebox_1.Type.Record(typebox_1.Type.String(), core_1.schemaFormat.TreeNodeSchemaDataFormat),
    root: core_1.schemaFormat.FieldSchemaFormat,
}, noAdditionalProps);
//# sourceMappingURL=format.js.map