"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.brandedNumberType = exports.brandedStringType = void 0;
const Type = __importStar(require("@sinclair/typebox"));
/**
 * Create a TypeBox string schema for a branded string type.
 * This only validates that the value is a string,
 * and not that it came from the correct branded type (that information is lost when serialized).
 */
function brandedStringType() {
    // This could use:
    // return TypeSystem.CreateType<T>(name, (options, value) => typeof value === "string")();
    // Since there isn't any useful custom validation to do and
    // TUnsafe is documented as unsupported in `typebox/compiler`,
    // opt for the compile time behavior like the above, but the runtime behavior of the built in string type.
    return Type.String();
}
exports.brandedStringType = brandedStringType;
/**
 * Create a TypeBox number schema for a branded number type.
 * {@link brandedStringType} but for numbers.
 */
function brandedNumberType(options) {
    // See comments on `brandedStringType`.
    return Type.Number(options);
}
exports.brandedNumberType = brandedNumberType;
//# sourceMappingURL=typeboxBrand.js.map