UNPKG

@upstart.gg/sdk

Version:

You can test the CLI without recompiling by running:

20 lines (18 loc) 566 B
import { Kind, Type, TypeRegistry } from "@sinclair/typebox"; //#region src/shared/utils/string-enum.ts function StringEnumCheck(schema, value) { return typeof value === "string" && schema.enum.includes(value); } TypeRegistry.Set("StringEnum", StringEnumCheck); /** `[Experimental]` Creates a Union type with a `enum` schema representation */ function StringEnum(values, options = {}) { return Type.Unsafe({ [Kind]: "StringEnum", type: "string", enum: values, ...options }); } //#endregion export { StringEnum }; //# sourceMappingURL=string-enum.js.map