{
  "version": 3,
  "sources": ["../Source/Type/index.ts", "../Source/Type/Test.ts"],
  "sourcesContent": ["/**\n * Utilities for working with type definitions in TypeScript modules.\n *\n * @note The functions provided by this module require the `typescript` peer dependency.\n *\n * @module @sorrell/utilities/type\n */\n/**\n * @file      index.ts\n * @author    Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license   MIT\n */\nexport * from \"./Test.ts\";\nexport * from \"./Test.Types.ts\";\nexport * from \"./Utility.Types.ts\";\n", "/**\n * @file      Test.ts\n * @author    Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license   MIT\n */\n/* eslint-disable jsdoc/require-example */\nimport TypeScript from \"typescript\";\n/**\n * Determine whether a given {@link TypeName} is a valid type name in TypeScript.\n *\n * @param TypeName - The type name to test.\n *\n * @returns {boolean} Whether the given {@link TypeName} is valid.\n */\nexport function IsValidTypeName(TypeName: string): boolean {\n    if (TypeName.length === 0) {\n        return false;\n    }\n    if (TypeName.trim() !== TypeName) {\n        return false;\n    }\n    const FileName: string = \"TypeNameValidation.ts\";\n    const SourceText: string = `type ${TypeName} = unknown;`;\n    const CompilerOptions: TypeScript.CompilerOptions = {\n        noEmit: true,\n        skipLibCheck: true,\n        target: TypeScript.ScriptTarget.Latest\n    };\n    const DefaultCompilerHost: TypeScript.CompilerHost = TypeScript.createCompilerHost(CompilerOptions, true);\n    const CompilerHost: TypeScript.CompilerHost = {\n        ...DefaultCompilerHost,\n        getSourceFile: (RequestedFileName: string, LanguageVersion: TypeScript.ScriptTarget | TypeScript.CreateSourceFileOptions, OnError: (Message: string) => void | undefined, ShouldCreateNewSourceFile: boolean | undefined): TypeScript.SourceFile | undefined => {\n            if (RequestedFileName === FileName) {\n                return TypeScript.createSourceFile(FileName, SourceText, LanguageVersion, true, TypeScript.ScriptKind.TS);\n            }\n            return DefaultCompilerHost.getSourceFile(RequestedFileName, LanguageVersion, OnError, ShouldCreateNewSourceFile);\n        }\n    };\n    const Program: TypeScript.Program = TypeScript.createProgram([FileName], CompilerOptions, CompilerHost);\n    const SourceFile: TypeScript.SourceFile | undefined = Program.getSourceFile(FileName);\n    if (SourceFile === undefined) {\n        return false;\n    }\n    if (Program.getSyntacticDiagnostics(SourceFile).length > 0) {\n        return false;\n    }\n    const [Statement] = SourceFile.statements;\n    if (SourceFile.statements.length !== 1 ||\n        Statement === undefined ||\n        TypeScript.isTypeAliasDeclaration(Statement) === false) {\n        return false;\n    }\n    return Statement.name.getText(SourceFile) === TypeName;\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOA,wBAAuB;AAQhB,SAAS,gBAAgB,UAA2B;AACvD,MAAI,SAAS,WAAW,GAAG;AACvB,WAAO;AAAA,EACX;AACA,MAAI,SAAS,KAAK,MAAM,UAAU;AAC9B,WAAO;AAAA,EACX;AACA,QAAM,WAAmB;AACzB,QAAM,aAAqB,QAAQ,QAAQ;AAC3C,QAAM,kBAA8C;AAAA,IAChD,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,QAAQ,kBAAAA,QAAW,aAAa;AAAA,EACpC;AACA,QAAM,sBAA+C,kBAAAA,QAAW,mBAAmB,iBAAiB,IAAI;AACxG,QAAM,eAAwC;AAAA,IAC1C,GAAG;AAAA,IACH,eAAe,CAAC,mBAA2B,iBAA+E,SAAgD,8BAAsF;AAC5P,UAAI,sBAAsB,UAAU;AAChC,eAAO,kBAAAA,QAAW,iBAAiB,UAAU,YAAY,iBAAiB,MAAM,kBAAAA,QAAW,WAAW,EAAE;AAAA,MAC5G;AACA,aAAO,oBAAoB,cAAc,mBAAmB,iBAAiB,SAAS,yBAAyB;AAAA,IACnH;AAAA,EACJ;AACA,QAAM,UAA8B,kBAAAA,QAAW,cAAc,CAAC,QAAQ,GAAG,iBAAiB,YAAY;AACtG,QAAM,aAAgD,QAAQ,cAAc,QAAQ;AACpF,MAAI,eAAe,QAAW;AAC1B,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