@teambit/typescript 0.0.1114 → 0.0.1116
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.bit-capsule-ready +0 -0
- package/dist/cmds/check-types.cmd.js.map +1 -1
- package/dist/cmds/write-tsconfig.cmd.js +1 -2
- package/dist/cmds/write-tsconfig.cmd.js.map +1 -1
- package/dist/dedupe-path.spec.js.map +1 -1
- package/dist/exceptions/index.js.map +1 -1
- package/dist/exceptions/transformer-not-found.js.map +1 -1
- package/dist/export-identifier.js.map +1 -1
- package/dist/identifier-list.js.map +1 -1
- package/dist/identifier.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{preview-1690168610397.js → preview-1690296596827.js} +2 -2
- package/dist/remove-types-task.js.map +1 -1
- package/dist/schema-extractor-context.js +9 -8
- package/dist/schema-extractor-context.js.map +1 -1
- package/dist/schema-transformer.plugin.js.map +1 -1
- package/dist/sourceFileTransformers/class.js.map +1 -1
- package/dist/sourceFileTransformers/empty-line-encoder.js.map +1 -1
- package/dist/sourceFileTransformers/export.js.map +1 -1
- package/dist/sourceFileTransformers/expression-statement.js.map +1 -1
- package/dist/sourceFileTransformers/function.js.map +1 -1
- package/dist/sourceFileTransformers/import.js.map +1 -1
- package/dist/sourceFileTransformers/index.js.map +1 -1
- package/dist/sourceFileTransformers/interface.js.map +1 -1
- package/dist/sourceFileTransformers/transform.js.map +1 -1
- package/dist/sourceFileTransformers/typeAlias.js.map +1 -1
- package/dist/sourceFileTransformers/variable.js.map +1 -1
- package/dist/transform-source-file.spec.js.map +1 -1
- package/dist/transformers/array-type.js.map +1 -1
- package/dist/transformers/binding-element.js.map +1 -1
- package/dist/transformers/class-declaration.js.map +1 -1
- package/dist/transformers/conditional-type.js.map +1 -1
- package/dist/transformers/constructor.js.map +1 -1
- package/dist/transformers/enum-declaration.js.map +1 -1
- package/dist/transformers/export-assignment.js.map +1 -1
- package/dist/transformers/export-declaration.js.map +1 -1
- package/dist/transformers/expression-statement.js.map +1 -1
- package/dist/transformers/function-like.js.map +1 -1
- package/dist/transformers/get-accessor.js.map +1 -1
- package/dist/transformers/import-declaration.js.map +1 -1
- package/dist/transformers/index-signature.js.map +1 -1
- package/dist/transformers/index.js.map +1 -1
- package/dist/transformers/indexed-access-type.js.map +1 -1
- package/dist/transformers/interface-declaration.js.map +1 -1
- package/dist/transformers/intersection-type.js.map +1 -1
- package/dist/transformers/keyword-type.js.map +1 -1
- package/dist/transformers/literal-type.js.map +1 -1
- package/dist/transformers/module-declaration.js.map +1 -1
- package/dist/transformers/named-tuple.js.map +1 -1
- package/dist/transformers/parameter.js.map +1 -1
- package/dist/transformers/parenthesized-type.js.map +1 -1
- package/dist/transformers/property-declaration.js.map +1 -1
- package/dist/transformers/set-accessor.js.map +1 -1
- package/dist/transformers/source-file-transformer.js.map +1 -1
- package/dist/transformers/template-literal-type-span.js.map +1 -1
- package/dist/transformers/template-literal-type.js.map +1 -1
- package/dist/transformers/this-type.js.map +1 -1
- package/dist/transformers/tuple-type.js.map +1 -1
- package/dist/transformers/type-alias.js.map +1 -1
- package/dist/transformers/type-literal.js.map +1 -1
- package/dist/transformers/type-operator.js.map +1 -1
- package/dist/transformers/type-predicate.js.map +1 -1
- package/dist/transformers/type-query.js.map +1 -1
- package/dist/transformers/type-reference.js.map +1 -1
- package/dist/transformers/union-type.js.map +1 -1
- package/dist/transformers/utils/jsdoc-to-doc-schema.js.map +1 -1
- package/dist/transformers/utils/parse-type-from-quick-info.js.map +1 -1
- package/dist/transformers/variable-declaration.js.map +1 -1
- package/dist/transformers/variable-statement.js.map +1 -1
- package/dist/tsconfig-writer.js.map +1 -1
- package/dist/typescript.aspect.js.map +1 -1
- package/dist/typescript.compiler.js.map +1 -1
- package/dist/typescript.compiler.spec.js.map +1 -1
- package/dist/typescript.composition.js.map +1 -1
- package/dist/typescript.extractor.js.map +1 -1
- package/dist/typescript.main.runtime.js +2 -2
- package/dist/typescript.main.runtime.js.map +1 -1
- package/dist/typescript.parser.js.map +1 -1
- package/dist/typescript.parser.spec.js.map +1 -1
- package/package-tar/teambit-typescript-0.0.1116.tgz +0 -0
- package/package.json +18 -18
- package/package-tar/teambit-typescript-0.0.1114.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FunctionLikeTransformer","predicate","node","kind","ts","SyntaxKind","FunctionDeclaration","ArrowFunction","MethodDeclaration","CallSignature","ConstructSignature","IndexSignature","FunctionType","MethodSignature","getIdentifiers","funcDec","Identifier","getName","getSourceFile","fileName","name","getText","transform","context","getQuickInfoFromDefaultModifier","defaultModifier","modifiers","find","modifier","DefaultKeyword","getQuickInfo","equalsGreaterThanToken","info","returnTypeStr","parseTypeFromQuickInfo","displaySig","body","displayString","args","pMapSeries","parameters","param","computeSchema","returnType","resolveType","Boolean","map","typeParameters","typeParam","location","getLocation","doc","jsDocToDocSchema","FunctionLikeSchema"],"sources":["function-like.ts"],"sourcesContent":["import { FunctionLikeSchema, ParameterSchema, SchemaNode, Modifier } from '@teambit/semantics.entities.semantic-schema';\nimport ts, { Node, SignatureDeclaration } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { parseTypeFromQuickInfo } from './utils/parse-type-from-quick-info';\nimport { Identifier } from '../identifier';\n\nexport class FunctionLikeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return (\n node.kind === ts.SyntaxKind.FunctionDeclaration ||\n node.kind === ts.SyntaxKind.ArrowFunction ||\n node.kind === ts.SyntaxKind.MethodDeclaration ||\n node.kind === ts.SyntaxKind.CallSignature ||\n node.kind === ts.SyntaxKind.ConstructSignature ||\n node.kind === ts.SyntaxKind.IndexSignature ||\n node.kind === ts.SyntaxKind.FunctionType ||\n node.kind === ts.SyntaxKind.MethodSignature\n );\n }\n\n // need to check for anonymous functions assigned for vars, const and let.\n async getIdentifiers(funcDec: SignatureDeclaration) {\n return [new Identifier(this.getName(funcDec), funcDec.getSourceFile().fileName)];\n }\n\n private getName(funcDec: SignatureDeclaration) {\n if (funcDec.kind === ts.SyntaxKind.ConstructSignature) return 'new';\n return funcDec.name?.getText() || '';\n }\n\n async transform(node: SignatureDeclaration, context: SchemaExtractorContext): Promise<SchemaNode> {\n const name = this.getName(node);\n const getQuickInfoFromDefaultModifier = async () => {\n const defaultModifier = node.modifiers?.find((modifier) => modifier.kind === ts.SyntaxKind.DefaultKeyword);\n if (defaultModifier) return context.getQuickInfo(defaultModifier);\n if (node.kind === ts.SyntaxKind.ArrowFunction) return context.getQuickInfo(node.equalsGreaterThanToken);\n return null;\n };\n const info = node.name ? await context.getQuickInfo(node.name) : await getQuickInfoFromDefaultModifier();\n const returnTypeStr = info ? parseTypeFromQuickInfo(info) : 'any';\n const displaySig = info?.body?.displayString || '';\n const args = (await pMapSeries(node.parameters, async (param) =>\n context.computeSchema(param)\n )) as ParameterSchema[];\n\n const returnType = await context.resolveType(node, returnTypeStr, Boolean(info));\n const modifiers = node.modifiers?.map((modifier) => modifier.getText()) || [];\n const typeParameters = node.typeParameters?.map((typeParam) => typeParam.name.getText());\n const location = context.getLocation(node);\n const doc = await context.jsDocToDocSchema(node);\n\n return new FunctionLikeSchema(\n location,\n name,\n args,\n returnType,\n displaySig,\n modifiers as Modifier[],\n doc,\n typeParameters\n );\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_semanticsEntities","data","require","_typescript","_interopRequireDefault","_pMapSeries","_parseTypeFromQuickInfo","_identifier","FunctionLikeTransformer","predicate","node","kind","ts","SyntaxKind","FunctionDeclaration","ArrowFunction","MethodDeclaration","CallSignature","ConstructSignature","IndexSignature","FunctionType","MethodSignature","getIdentifiers","funcDec","Identifier","getName","getSourceFile","fileName","_funcDec$name","name","getText","transform","context","_info$body","_node$modifiers2","_node$typeParameters","getQuickInfoFromDefaultModifier","_node$modifiers","defaultModifier","modifiers","find","modifier","DefaultKeyword","getQuickInfo","equalsGreaterThanToken","info","returnTypeStr","parseTypeFromQuickInfo","displaySig","body","displayString","args","pMapSeries","parameters","param","computeSchema","returnType","resolveType","Boolean","map","typeParameters","typeParam","location","getLocation","doc","jsDocToDocSchema","FunctionLikeSchema","exports"],"sources":["function-like.ts"],"sourcesContent":["import { FunctionLikeSchema, ParameterSchema, SchemaNode, Modifier } from '@teambit/semantics.entities.semantic-schema';\nimport ts, { Node, SignatureDeclaration } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { parseTypeFromQuickInfo } from './utils/parse-type-from-quick-info';\nimport { Identifier } from '../identifier';\n\nexport class FunctionLikeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return (\n node.kind === ts.SyntaxKind.FunctionDeclaration ||\n node.kind === ts.SyntaxKind.ArrowFunction ||\n node.kind === ts.SyntaxKind.MethodDeclaration ||\n node.kind === ts.SyntaxKind.CallSignature ||\n node.kind === ts.SyntaxKind.ConstructSignature ||\n node.kind === ts.SyntaxKind.IndexSignature ||\n node.kind === ts.SyntaxKind.FunctionType ||\n node.kind === ts.SyntaxKind.MethodSignature\n );\n }\n\n // need to check for anonymous functions assigned for vars, const and let.\n async getIdentifiers(funcDec: SignatureDeclaration) {\n return [new Identifier(this.getName(funcDec), funcDec.getSourceFile().fileName)];\n }\n\n private getName(funcDec: SignatureDeclaration) {\n if (funcDec.kind === ts.SyntaxKind.ConstructSignature) return 'new';\n return funcDec.name?.getText() || '';\n }\n\n async transform(node: SignatureDeclaration, context: SchemaExtractorContext): Promise<SchemaNode> {\n const name = this.getName(node);\n const getQuickInfoFromDefaultModifier = async () => {\n const defaultModifier = node.modifiers?.find((modifier) => modifier.kind === ts.SyntaxKind.DefaultKeyword);\n if (defaultModifier) return context.getQuickInfo(defaultModifier);\n if (node.kind === ts.SyntaxKind.ArrowFunction) return context.getQuickInfo(node.equalsGreaterThanToken);\n return null;\n };\n const info = node.name ? await context.getQuickInfo(node.name) : await getQuickInfoFromDefaultModifier();\n const returnTypeStr = info ? parseTypeFromQuickInfo(info) : 'any';\n const displaySig = info?.body?.displayString || '';\n const args = (await pMapSeries(node.parameters, async (param) =>\n context.computeSchema(param)\n )) as ParameterSchema[];\n\n const returnType = await context.resolveType(node, returnTypeStr, Boolean(info));\n const modifiers = node.modifiers?.map((modifier) => modifier.getText()) || [];\n const typeParameters = node.typeParameters?.map((typeParam) => typeParam.name.getText());\n const location = context.getLocation(node);\n const doc = await context.jsDocToDocSchema(node);\n\n return new FunctionLikeSchema(\n location,\n name,\n args,\n returnType,\n displaySig,\n modifiers as Modifier[],\n doc,\n typeParameters\n );\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,wBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,uBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,YAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,WAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMO,uBAAuB,CAA8B;EAChEC,SAASA,CAACC,IAAU,EAAE;IACpB,OACEA,IAAI,CAACC,IAAI,KAAKC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8B,cAAc,IAAAzB,oBAAA,GAAGzB,IAAI,CAACkD,cAAc,cAAAzB,oBAAA,uBAAnBA,oBAAA,CAAqBwB,GAAG,CAAEE,SAAS,IAAKA,SAAS,CAAChC,IAAI,CAACC,OAAO,CAAC,CAAC,CAAC;IACxF,MAAMgC,QAAQ,GAAG9B,OAAO,CAAC+B,WAAW,CAACrD,IAAI,CAAC;IAC1C,MAAMsD,GAAG,GAAG,MAAMhC,OAAO,CAACiC,gBAAgB,CAACvD,IAAI,CAAC;IAEhD,OAAO,KAAIwD,uCAAkB,EAC3BJ,QAAQ,EACRjC,IAAI,EACJsB,IAAI,EACJK,UAAU,EACVR,UAAU,EACVT,SAAS,EACTyB,GAAG,EACHJ,cACF,CAAC;EACH;AACF;AAACO,OAAA,CAAA3D,uBAAA,GAAAA,uBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GetAccessorTransformer","predicate","node","kind","ts","SyntaxKind","GetAccessor","getIdentifiers","transform","context","info","getQuickInfo","name","displaySig","body","displayString","typeStr","parseTypeFromQuickInfo","type","resolveType","GetAccessorSchema","getLocation","getText"],"sources":["get-accessor.ts"],"sourcesContent":["import ts, { Node, GetAccessorDeclaration } from 'typescript';\nimport { GetAccessorSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { parseTypeFromQuickInfo } from './utils/parse-type-from-quick-info';\nimport { Identifier } from '../identifier';\n\nexport class GetAccessorTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.GetAccessor;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: GetAccessorDeclaration, context: SchemaExtractorContext) {\n const info = await context.getQuickInfo(node.name);\n const displaySig = info?.body?.displayString || '';\n const typeStr = parseTypeFromQuickInfo(info);\n const type = await context.resolveType(node, typeStr);\n return new GetAccessorSchema(context.getLocation(node), node.name.getText(), type, displaySig);\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","_parseTypeFromQuickInfo","GetAccessorTransformer","predicate","node","kind","ts","SyntaxKind","GetAccessor","getIdentifiers","transform","context","_info$body","info","getQuickInfo","name","displaySig","body","displayString","typeStr","parseTypeFromQuickInfo","type","resolveType","GetAccessorSchema","getLocation","getText","exports"],"sources":["get-accessor.ts"],"sourcesContent":["import ts, { Node, GetAccessorDeclaration } from 'typescript';\nimport { GetAccessorSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { parseTypeFromQuickInfo } from './utils/parse-type-from-quick-info';\nimport { Identifier } from '../identifier';\n\nexport class GetAccessorTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.GetAccessor;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: GetAccessorDeclaration, context: SchemaExtractorContext) {\n const info = await context.getQuickInfo(node.name);\n const displaySig = info?.body?.displayString || '';\n const typeStr = parseTypeFromQuickInfo(info);\n const type = await context.resolveType(node, typeStr);\n return new GetAccessorSchema(context.getLocation(node), node.name.getText(), type, displaySig);\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,wBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,uBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,MAAMK,sBAAsB,CAA8B;EAC/DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,WAAW;EAChD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAA4B,EAAEO,OAA+B,EAAE;IAAA,IAAAC,UAAA;IAC7E,MAAMC,IAAI,GAAG,MAAMF,OAAO,CAACG,YAAY,CAACV,IAAI,CAACW,IAAI,CAAC;IAClD,MAAMC,UAAU,GAAG,CAAAH,IAAI,aAAJA,IAAI,wBAAAD,UAAA,GAAJC,IAAI,CAAEI,IAAI,cAAAL,UAAA,uBAAVA,UAAA,CAAYM,aAAa,KAAI,EAAE;IAClD,MAAMC,OAAO,GAAG,IAAAC,gDAAsB,EAACP,IAAI,CAAC;IAC5C,MAAMQ,IAAI,GAAG,MAAMV,OAAO,CAACW,WAAW,CAAClB,IAAI,EAAEe,OAAO,CAAC;IACrD,OAAO,KAAII,sCAAiB,EAACZ,OAAO,CAACa,WAAW,CAACpB,IAAI,CAAC,EAAEA,IAAI,CAACW,IAAI,CAACU,OAAO,CAAC,CAAC,EAAEJ,IAAI,EAAEL,UAAU,CAAC;EAChG;AACF;AAACU,OAAA,CAAAxB,sBAAA,GAAAA,sBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ImportDeclarationTransformer","predicate","node","kind","SyntaxKind","ImportDeclaration","getIdentifiers","importDec","importClause","sourceFile","getSourceFile","fileName","rawSourceFilePath","moduleSpecifier","getText","sourceFilePath","substring","length","namedBindings","Identifier","undefined","NamedImports","elements","map","name","propertyName","id","alias","identifier","NamespaceImport","transform","context","location","getLocation","UnImplementedSchema","toString"],"sources":["import-declaration.ts"],"sourcesContent":["import { ImportDeclaration, Node, SyntaxKind } from 'typescript';\nimport { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class ImportDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ImportDeclaration;\n }\n\n async getIdentifiers(importDec: ImportDeclaration): Promise<Identifier[]> {\n if (!importDec.importClause) return [];\n\n const sourceFile = importDec.getSourceFile().fileName;\n const rawSourceFilePath = importDec.moduleSpecifier.getText();\n const sourceFilePath = rawSourceFilePath.substring(1, rawSourceFilePath.length - 1);\n\n // import A from 'a'\n if (!importDec.importClause.namedBindings) {\n return [new Identifier(importDec.importClause.getText(), sourceFile, undefined, sourceFilePath)];\n }\n\n // import { A } from 'a'\n if (importDec.importClause.namedBindings?.kind === SyntaxKind.NamedImports) {\n const { elements } = importDec.importClause.namedBindings;\n\n return elements.map(({ name, propertyName }) => {\n const id = propertyName?.getText() || name.getText();\n const alias = (propertyName && name.getText()) || undefined;\n const identifier = new Identifier(id, sourceFile, alias, sourceFilePath);\n return identifier;\n });\n }\n\n // import * as A from 'a';\n if (importDec.importClause.namedBindings.kind === SyntaxKind.NamespaceImport) {\n return [\n new Identifier(\n importDec.importClause.namedBindings.name.getText(),\n sourceFile,\n undefined,\n importDec.moduleSpecifier.getText()\n ),\n ];\n }\n\n return [];\n }\n\n async transform(node: ImportDeclaration, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n\n return new UnImplementedSchema(location, node.getText(), node.kind.toString());\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","require","_semanticsEntities","_identifier","ImportDeclarationTransformer","predicate","node","kind","SyntaxKind","ImportDeclaration","getIdentifiers","importDec","_importDec$importClau","importClause","sourceFile","getSourceFile","fileName","rawSourceFilePath","moduleSpecifier","getText","sourceFilePath","substring","length","namedBindings","Identifier","undefined","NamedImports","elements","map","name","propertyName","id","alias","identifier","NamespaceImport","transform","context","location","getLocation","UnImplementedSchema","toString","exports"],"sources":["import-declaration.ts"],"sourcesContent":["import { ImportDeclaration, Node, SyntaxKind } from 'typescript';\nimport { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class ImportDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ImportDeclaration;\n }\n\n async getIdentifiers(importDec: ImportDeclaration): Promise<Identifier[]> {\n if (!importDec.importClause) return [];\n\n const sourceFile = importDec.getSourceFile().fileName;\n const rawSourceFilePath = importDec.moduleSpecifier.getText();\n const sourceFilePath = rawSourceFilePath.substring(1, rawSourceFilePath.length - 1);\n\n // import A from 'a'\n if (!importDec.importClause.namedBindings) {\n return [new Identifier(importDec.importClause.getText(), sourceFile, undefined, sourceFilePath)];\n }\n\n // import { A } from 'a'\n if (importDec.importClause.namedBindings?.kind === SyntaxKind.NamedImports) {\n const { elements } = importDec.importClause.namedBindings;\n\n return elements.map(({ name, propertyName }) => {\n const id = propertyName?.getText() || name.getText();\n const alias = (propertyName && name.getText()) || undefined;\n const identifier = new Identifier(id, sourceFile, alias, sourceFilePath);\n return identifier;\n });\n }\n\n // import * as A from 'a';\n if (importDec.importClause.namedBindings.kind === SyntaxKind.NamespaceImport) {\n return [\n new Identifier(\n importDec.importClause.namedBindings.name.getText(),\n sourceFile,\n undefined,\n importDec.moduleSpecifier.getText()\n ),\n ];\n }\n\n return [];\n }\n\n async transform(node: ImportDeclaration, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n\n return new UnImplementedSchema(location, node.getText(), node.kind.toString());\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,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C,KAAK;QAC9C,MAAMC,EAAE,GAAG,CAAAD,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEX,OAAO,CAAC,CAAC,KAAIU,IAAI,CAACV,OAAO,CAAC,CAAC;QACpD,MAAMa,KAAK,GAAIF,YAAY,IAAID,IAAI,CAACV,OAAO,CAAC,CAAC,IAAKM,SAAS;QAC3D,MAAMQ,UAAU,GAAG,KAAIT,wBAAU,EAACO,EAAE,EAAEjB,UAAU,EAAEkB,KAAK,EAAEZ,cAAc,CAAC;QACxE,OAAOa,UAAU;MACnB,CAAC,CAAC;IACJ;;IAEA;IACA,IAAItB,SAAS,CAACE,YAAY,CAACU,aAAa,CAAChB,IAAI,KAAKC,wBAAU,CAAC0B,eAAe,EAAE;MAC5E,OAAO,CACL,KAAIV,wBAAU,EACZb,SAAS,CAACE,YAAY,CAACU,aAAa,CAACM,IAAI,CAACV,OAAO,CAAC,CAAC,EACnDL,UAAU,EACVW,SAAS,EACTd,SAAS,CAACO,eAAe,CAACC,OAAO,CAAC,CACpC,CAAC,CACF;IACH;IAEA,OAAO,EAAE;EACX;EAEA,MAAMgB,SAASA,CAAC7B,IAAuB,EAAE8B,OAA+B,EAAE;IACxE,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAAChC,IAAI,CAAC;IAE1C,OAAO,KAAIiC,wCAAmB,EAACF,QAAQ,EAAE/B,IAAI,CAACa,OAAO,CAAC,CAAC,EAAEb,IAAI,CAACC,IAAI,CAACiC,QAAQ,CAAC,CAAC,CAAC;EAChF;AACF;AAACC,OAAA,CAAArC,4BAAA,GAAAA,4BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IndexSignatureTransformer","predicate","node","kind","ts","SyntaxKind","IndexSignature","getIdentifiers","transform","context","params","pMapSeries","parameters","param","computeSchema","type","IndexSignatureSchema","getLocation"],"sources":["index-signature.ts"],"sourcesContent":["import ts, { Node, IndexSignatureDeclaration } from 'typescript';\nimport { IndexSignatureSchema, ParameterSchema } from '@teambit/semantics.entities.semantic-schema';\nimport pMapSeries from 'p-map-series';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class IndexSignatureTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.IndexSignature;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IndexSignatureDeclaration, context: SchemaExtractorContext) {\n const params = (await pMapSeries(node.parameters, async (param) =>\n context.computeSchema(param)\n )) as ParameterSchema[];\n const type = await context.computeSchema(node.type);\n return new IndexSignatureSchema(context.getLocation(node), params, type);\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","_pMapSeries","IndexSignatureTransformer","predicate","node","kind","ts","SyntaxKind","IndexSignature","getIdentifiers","transform","context","params","pMapSeries","parameters","param","computeSchema","type","IndexSignatureSchema","getLocation","exports"],"sources":["index-signature.ts"],"sourcesContent":["import ts, { Node, IndexSignatureDeclaration } from 'typescript';\nimport { IndexSignatureSchema, ParameterSchema } from '@teambit/semantics.entities.semantic-schema';\nimport pMapSeries from 'p-map-series';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class IndexSignatureTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.IndexSignature;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IndexSignatureDeclaration, context: SchemaExtractorContext) {\n const params = (await pMapSeries(node.parameters, async (param) =>\n context.computeSchema(param)\n )) as ParameterSchema[];\n const type = await context.computeSchema(node.type);\n return new IndexSignatureSchema(context.getLocation(node), params, type);\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMK,yBAAyB,CAA8B;EAClEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,cAAc;EACnD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAA+B,EAAEO,OAA+B,EAAE;IAChF,MAAMC,MAAM,GAAI,MAAM,IAAAC,qBAAU,EAACT,IAAI,CAACU,UAAU,EAAE,MAAOC,KAAK,IAC5DJ,OAAO,CAACK,aAAa,CAACD,KAAK,CAC7B,CAAuB;IACvB,MAAME,IAAI,GAAG,MAAMN,OAAO,CAACK,aAAa,CAACZ,IAAI,CAACa,IAAI,CAAC;IACnD,OAAO,KAAIC,yCAAoB,EAACP,OAAO,CAACQ,WAAW,CAACf,IAAI,CAAC,EAAEQ,MAAM,EAAEK,IAAI,CAAC;EAC1E;AACF;AAACG,OAAA,CAAAlB,yBAAA,GAAAA,yBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { ExportDeclarationTransformer } from './export-declaration';\nexport { FunctionLikeTransformer } from './function-like';\nexport { ParameterTransformer } from './parameter';\nexport { VariableStatementTransformer } from './variable-statement';\nexport { VariableDeclaration } from './variable-declaration';\nexport { SourceFileTransformer } from './source-file-transformer';\nexport { TypeAliasTransformer } from './type-alias';\nexport { IntersectionTypeTransformer } from './intersection-type';\nexport { UnionTypeTransformer } from './union-type';\nexport { TypeReferenceTransformer } from './type-reference';\nexport { TypeLiteralTransformer } from './type-literal';\nexport { LiteralTypeTransformer } from './literal-type';\nexport { TypeQueryTransformer } from './type-query';\nexport { TypeOperatorTransformer } from './type-operator';\nexport { KeywordTypeTransformer } from './keyword-type';\nexport { TupleTypeTransformer } from './tuple-type';\nexport { ParenthesizedTypeTransformer } from './parenthesized-type';\nexport { TypePredicateTransformer } from './type-predicate';\nexport { IndexedAccessTypeTransformer } from './indexed-access-type';\nexport { TemplateLiteralTypeSpanTransformer } from './template-literal-type-span';\nexport { TemplateLiteralTypeTransformer } from './template-literal-type';\nexport { ThisTypeTransformer } from './this-type';\nexport { ConditionalTypeTransformer } from './conditional-type';\nexport { NamedTupleTransformer } from './named-tuple';\nexport { ArrayTypeTransformer } from './array-type';\nexport { ClassDeclarationTransformer } from './class-declaration';\nexport { ConstructorTransformer } from './constructor';\nexport { PropertyDeclarationTransformer } from './property-declaration';\nexport { SetAccessorTransformer } from './set-accessor';\nexport { GetAccessorTransformer } from './get-accessor';\nexport { IndexSignatureTransformer } from './index-signature';\nexport { InterfaceDeclarationTransformer } from './interface-declaration';\nexport { EnumDeclarationTransformer } from './enum-declaration';\nexport { BindingElementTransformer } from './binding-element';\nexport { ExportAssignmentTransformer } from './export-assignment';\nexport { ImportDeclarationTransformer } from './import-declaration';\nexport { ExpressionStatementTransformer } from './expression-statement';\nexport { ModuleDeclarationTransformer } from './module-declaration';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_exportDeclaration","data","require","_functionLike","_parameter","_variableStatement","_variableDeclaration","_sourceFileTransformer","_typeAlias","_intersectionType","_unionType","_typeReference","_typeLiteral","_literalType","_typeQuery","_typeOperator","_keywordType","_tupleType","_parenthesizedType","_typePredicate","_indexedAccessType","_templateLiteralTypeSpan","_templateLiteralType","_thisType","_conditionalType","_namedTuple","_arrayType","_classDeclaration","_constructor","_propertyDeclaration","_setAccessor","_getAccessor","_indexSignature","_interfaceDeclaration","_enumDeclaration","_bindingElement","_exportAssignment","_importDeclaration","_expressionStatement","_moduleDeclaration"],"sources":["index.ts"],"sourcesContent":["export { ExportDeclarationTransformer } from './export-declaration';\nexport { FunctionLikeTransformer } from './function-like';\nexport { ParameterTransformer } from './parameter';\nexport { VariableStatementTransformer } from './variable-statement';\nexport { VariableDeclaration } from './variable-declaration';\nexport { SourceFileTransformer } from './source-file-transformer';\nexport { TypeAliasTransformer } from './type-alias';\nexport { IntersectionTypeTransformer } from './intersection-type';\nexport { UnionTypeTransformer } from './union-type';\nexport { TypeReferenceTransformer } from './type-reference';\nexport { TypeLiteralTransformer } from './type-literal';\nexport { LiteralTypeTransformer } from './literal-type';\nexport { TypeQueryTransformer } from './type-query';\nexport { TypeOperatorTransformer } from './type-operator';\nexport { KeywordTypeTransformer } from './keyword-type';\nexport { TupleTypeTransformer } from './tuple-type';\nexport { ParenthesizedTypeTransformer } from './parenthesized-type';\nexport { TypePredicateTransformer } from './type-predicate';\nexport { IndexedAccessTypeTransformer } from './indexed-access-type';\nexport { TemplateLiteralTypeSpanTransformer } from './template-literal-type-span';\nexport { TemplateLiteralTypeTransformer } from './template-literal-type';\nexport { ThisTypeTransformer } from './this-type';\nexport { ConditionalTypeTransformer } from './conditional-type';\nexport { NamedTupleTransformer } from './named-tuple';\nexport { ArrayTypeTransformer } from './array-type';\nexport { ClassDeclarationTransformer } from './class-declaration';\nexport { ConstructorTransformer } from './constructor';\nexport { PropertyDeclarationTransformer } from './property-declaration';\nexport { SetAccessorTransformer } from './set-accessor';\nexport { GetAccessorTransformer } from './get-accessor';\nexport { IndexSignatureTransformer } from './index-signature';\nexport { InterfaceDeclarationTransformer } from './interface-declaration';\nexport { EnumDeclarationTransformer } from './enum-declaration';\nexport { BindingElementTransformer } from './binding-element';\nexport { ExportAssignmentTransformer } from './export-assignment';\nexport { ImportDeclarationTransformer } from './import-declaration';\nexport { ExpressionStatementTransformer } from './expression-statement';\nexport { ModuleDeclarationTransformer } from './module-declaration';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,cAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,aAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,mBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,kBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,qBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA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A,YAAAA,CAAA;IAAA,OAAAjC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAkC,gBAAA;EAAA,MAAAlC,IAAA,GAAAC,OAAA;EAAAiC,eAAA,YAAAA,CAAA;IAAA,OAAAlC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAmC,kBAAA;EAAA,MAAAnC,IAAA,GAAAC,OAAA;EAAAkC,iBAAA,YAAAA,CAAA;IAAA,OAAAnC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAoC,mBAAA;EAAA,MAAApC,IAAA,GAAAC,OAAA;EAAAmC,kBAAA,YAAAA,CAAA;IAAA,OAAApC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAqC,qBAAA;EAAA,MAAArC,IAAA,GAAAC,OAAA;EAAAoC,oBAAA,YAAAA,CAAA;IAAA,OAAArC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAsC,mBAAA;EAAA,MAAAtC,IAAA,GAAAC,OAAA;EAAAqC,kBAAA,YAAAA,CAAA;IAAA,OAAAtC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IndexedAccessTypeTransformer","predicate","node","kind","SyntaxKind","IndexedAccessType","getIdentifiers","transform","context","objectType","computeSchema","indexType","IndexedAccessSchema","getLocation"],"sources":["indexed-access-type.ts"],"sourcesContent":["import { IndexedAccessTypeNode, Node, SyntaxKind } from 'typescript';\nimport { IndexedAccessSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class IndexedAccessTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.IndexedAccessType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IndexedAccessTypeNode, context: SchemaExtractorContext) {\n const objectType = await context.computeSchema(node.objectType);\n const indexType = await context.computeSchema(node.indexType);\n return new IndexedAccessSchema(context.getLocation(node), objectType, indexType);\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","require","_semanticsEntities","IndexedAccessTypeTransformer","predicate","node","kind","SyntaxKind","IndexedAccessType","getIdentifiers","transform","context","objectType","computeSchema","indexType","IndexedAccessSchema","getLocation","exports"],"sources":["indexed-access-type.ts"],"sourcesContent":["import { IndexedAccessTypeNode, Node, SyntaxKind } from 'typescript';\nimport { IndexedAccessSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class IndexedAccessTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.IndexedAccessType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IndexedAccessTypeNode, context: SchemaExtractorContext) {\n const objectType = await context.computeSchema(node.objectType);\n const indexType = await context.computeSchema(node.indexType);\n return new IndexedAccessSchema(context.getLocation(node), objectType, indexType);\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMG,4BAA4B,CAA8B;EACrEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,iBAAiB;EACnD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACL,IAA2B,EAAEM,OAA+B,EAAE;IAC5E,MAAMC,UAAU,GAAG,MAAMD,OAAO,CAACE,aAAa,CAACR,IAAI,CAACO,UAAU,CAAC;IAC/D,MAAME,SAAS,GAAG,MAAMH,OAAO,CAACE,aAAa,CAACR,IAAI,CAACS,SAAS,CAAC;IAC7D,OAAO,KAAIC,wCAAmB,EAACJ,OAAO,CAACK,WAAW,CAACX,IAAI,CAAC,EAAEO,UAAU,EAAEE,SAAS,CAAC;EAClF;AACF;AAACG,OAAA,CAAAd,4BAAA,GAAAA,4BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["InterfaceDeclarationTransformer","predicate","node","kind","SyntaxKind","InterfaceDeclaration","getIdentifiers","Identifier","name","getText","getSourceFile","fileName","getExpressionWithTypeArgs","context","heritageClauses","pMapSeries","
|
|
1
|
+
{"version":3,"names":["_typescript","data","require","_pMapSeries","_interopRequireDefault","_semanticsEntities","_identifier","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","InterfaceDeclarationTransformer","predicate","node","kind","SyntaxKind","InterfaceDeclaration","getIdentifiers","Identifier","name","getText","getSourceFile","fileName","getExpressionWithTypeArgs","context","heritageClauses","pMapSeries","heritageClause","token","ExtendsKeyword","flatMap","h","types","map","type","expressionWithTypeArgs","typeArguments","expression","typeArgsNodes","t","computeSchema","location","getLocation","expressionNode","visitDefinition","UnresolvedSchema","ExpressionWithTypeArgumentsSchema","transform","interfaceDec","_interfaceDec$typePar","members","member","doc","jsDocToDocSchema","signature","getQuickInfoDisplayString","undefined","extendsNodes","typeParameters","typeParam","Error","InterfaceSchema","exports"],"sources":["interface-declaration.ts"],"sourcesContent":["import ts, { Node, InterfaceDeclaration, SyntaxKind } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport {\n ExpressionWithTypeArgumentsSchema,\n InterfaceSchema,\n UnresolvedSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class InterfaceDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.InterfaceDeclaration;\n }\n\n async getIdentifiers(node: InterfaceDeclaration): Promise<Identifier[]> {\n return [new Identifier(node.name.getText(), node.getSourceFile().fileName)];\n }\n\n private async getExpressionWithTypeArgs(node: InterfaceDeclaration, context: SchemaExtractorContext) {\n if (!node.heritageClauses) return [];\n\n return pMapSeries(\n node.heritageClauses\n .filter((heritageClause: ts.HeritageClause) => heritageClause.token === SyntaxKind.ExtendsKeyword)\n .flatMap((h: ts.HeritageClause) => {\n const { types } = h;\n const name = h.getText();\n return types.map((type) => ({ ...type, name }));\n }),\n async (expressionWithTypeArgs: ts.ExpressionWithTypeArguments & { name: string }) => {\n const { typeArguments, expression, name } = expressionWithTypeArgs;\n const typeArgsNodes = typeArguments ? await pMapSeries(typeArguments, (t) => context.computeSchema(t)) : [];\n const location = context.getLocation(expression);\n const expressionNode =\n (await context.visitDefinition(expression)) || new UnresolvedSchema(location, expression.getText());\n return new ExpressionWithTypeArgumentsSchema(typeArgsNodes, expressionNode, name, location);\n }\n );\n }\n\n async transform(interfaceDec: InterfaceDeclaration, context: SchemaExtractorContext) {\n const members = await pMapSeries(interfaceDec.members, (member) => context.computeSchema(member));\n const doc = await context.jsDocToDocSchema(interfaceDec);\n const signature = interfaceDec.name ? await context.getQuickInfoDisplayString(interfaceDec.name) : undefined;\n const extendsNodes = await this.getExpressionWithTypeArgs(interfaceDec, context);\n const typeParameters = interfaceDec.typeParameters?.map((typeParam) => {\n return typeParam.name.getText();\n });\n\n if (!signature) {\n throw Error(`Missing signature for interface ${interfaceDec.name.getText()} declaration`);\n }\n\n return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,CAA6BhB,GAAG,CAAE0B,SAAS,IAAK;MACrE,OAAOA,SAAS,CAACxC,IAAI,CAACC,OAAO,CAAC,CAAC;IACjC,CAAC,CAAC;IAEF,IAAI,CAACkC,SAAS,EAAE;MACd,MAAMM,KAAK,CAAE,mCAAkCZ,YAAY,CAAC7B,IAAI,CAACC,OAAO,CAAC,CAAE,cAAa,CAAC;IAC3F;IAEA,OAAO,KAAIyC,oCAAe,EACxBrC,OAAO,CAACkB,WAAW,CAACM,YAAY,CAAC,EACjCA,YAAY,CAAC7B,IAAI,CAACC,OAAO,CAAC,CAAC,EAC3BkC,SAAS,EACTG,YAAY,EACZP,OAAO,EACPE,GAAG,EACHM,cACF,CAAC;EACH;AACF;AAACI,OAAA,CAAAnD,+BAAA,GAAAA,+BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IntersectionTypeTransformer","predicate","node","kind","ts","SyntaxKind","IntersectionType","getIdentifiers","transform","context","types","pMapSeries","type","typeSchema","computeSchema","location","getLocation","TypeIntersectionSchema"],"sources":["intersection-type.ts"],"sourcesContent":["import ts, { Node, IntersectionTypeNode } from 'typescript';\nimport { TypeIntersectionSchema } from '@teambit/semantics.entities.semantic-schema';\nimport pMapSeries from 'p-map-series';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class IntersectionTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.IntersectionType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IntersectionTypeNode, context: SchemaExtractorContext) {\n const types = await pMapSeries(node.types, async (type) => {\n const typeSchema = context.computeSchema(type);\n return typeSchema;\n });\n const location = context.getLocation(node);\n return new TypeIntersectionSchema(location, types);\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","_pMapSeries","IntersectionTypeTransformer","predicate","node","kind","ts","SyntaxKind","IntersectionType","getIdentifiers","transform","context","types","pMapSeries","type","typeSchema","computeSchema","location","getLocation","TypeIntersectionSchema","exports"],"sources":["intersection-type.ts"],"sourcesContent":["import ts, { Node, IntersectionTypeNode } from 'typescript';\nimport { TypeIntersectionSchema } from '@teambit/semantics.entities.semantic-schema';\nimport pMapSeries from 'p-map-series';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class IntersectionTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.IntersectionType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IntersectionTypeNode, context: SchemaExtractorContext) {\n const types = await pMapSeries(node.types, async (type) => {\n const typeSchema = context.computeSchema(type);\n return typeSchema;\n });\n const location = context.getLocation(node);\n return new TypeIntersectionSchema(location, types);\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMK,2BAA2B,CAA8B;EACpEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,gBAAgB;EACrD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAA0B,EAAEO,OAA+B,EAAE;IAC3E,MAAMC,KAAK,GAAG,MAAM,IAAAC,qBAAU,EAACT,IAAI,CAACQ,KAAK,EAAE,MAAOE,IAAI,IAAK;MACzD,MAAMC,UAAU,GAAGJ,OAAO,CAACK,aAAa,CAACF,IAAI,CAAC;MAC9C,OAAOC,UAAU;IACnB,CAAC,CAAC;IACF,MAAME,QAAQ,GAAGN,OAAO,CAACO,WAAW,CAACd,IAAI,CAAC;IAC1C,OAAO,KAAIe,2CAAsB,EAACF,QAAQ,EAAEL,KAAK,CAAC;EACpD;AACF;AAACQ,OAAA,CAAAlB,2BAAA,GAAAA,2BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["KeywordTypeTransformer","predicate","node","kind","SyntaxKind","AnyKeyword","BigIntKeyword","BooleanKeyword","IntrinsicKeyword","NeverKeyword","NumberKeyword","ObjectKeyword","StringKeyword","SymbolKeyword","UndefinedKeyword","UnknownKeyword","VoidKeyword","getIdentifiers","transform","context","location","getLocation","KeywordTypeSchema","getText"],"sources":["keyword-type.ts"],"sourcesContent":["import { Node, SyntaxKind } from 'typescript';\nimport { KeywordTypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\n/**\n * whether it's kind of `ts.KeywordTypeSyntaxKind`\n */\nexport class KeywordTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n switch (node.kind) {\n case SyntaxKind.AnyKeyword:\n case SyntaxKind.BigIntKeyword:\n case SyntaxKind.BooleanKeyword:\n case SyntaxKind.IntrinsicKeyword:\n case SyntaxKind.NeverKeyword:\n case SyntaxKind.NumberKeyword:\n case SyntaxKind.ObjectKeyword:\n case SyntaxKind.StringKeyword:\n case SyntaxKind.SymbolKeyword:\n case SyntaxKind.UndefinedKeyword:\n case SyntaxKind.UnknownKeyword:\n case SyntaxKind.VoidKeyword:\n return true;\n default:\n return false;\n }\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: Node, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new KeywordTypeSchema(location, node.getText());\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","require","_semanticsEntities","KeywordTypeTransformer","predicate","node","kind","SyntaxKind","AnyKeyword","BigIntKeyword","BooleanKeyword","IntrinsicKeyword","NeverKeyword","NumberKeyword","ObjectKeyword","StringKeyword","SymbolKeyword","UndefinedKeyword","UnknownKeyword","VoidKeyword","getIdentifiers","transform","context","location","getLocation","KeywordTypeSchema","getText","exports"],"sources":["keyword-type.ts"],"sourcesContent":["import { Node, SyntaxKind } from 'typescript';\nimport { KeywordTypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\n/**\n * whether it's kind of `ts.KeywordTypeSyntaxKind`\n */\nexport class KeywordTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n switch (node.kind) {\n case SyntaxKind.AnyKeyword:\n case SyntaxKind.BigIntKeyword:\n case SyntaxKind.BooleanKeyword:\n case SyntaxKind.IntrinsicKeyword:\n case SyntaxKind.NeverKeyword:\n case SyntaxKind.NumberKeyword:\n case SyntaxKind.ObjectKeyword:\n case SyntaxKind.StringKeyword:\n case SyntaxKind.SymbolKeyword:\n case SyntaxKind.UndefinedKeyword:\n case SyntaxKind.UnknownKeyword:\n case SyntaxKind.VoidKeyword:\n return true;\n default:\n return false;\n }\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: Node, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new KeywordTypeSchema(location, node.getText());\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA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","transform","context","location","getLocation","LiteralTypeSchema","getText"],"sources":["literal-type.ts"],"sourcesContent":["import ts, { LiteralTypeNode, Node } from 'typescript';\nimport { LiteralTypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\n/**\n * e.g. string/boolean\n */\nexport class LiteralTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.LiteralType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: LiteralTypeNode, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new LiteralTypeSchema(location, node.getText());\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","LiteralTypeTransformer","predicate","node","kind","ts","SyntaxKind","LiteralType","getIdentifiers","transform","context","location","getLocation","LiteralTypeSchema","getText","exports"],"sources":["literal-type.ts"],"sourcesContent":["import ts, { LiteralTypeNode, Node } from 'typescript';\nimport { LiteralTypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\n/**\n * e.g. string/boolean\n */\nexport class LiteralTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.LiteralType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: LiteralTypeNode, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new LiteralTypeSchema(location, node.getText());\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA;AACA;AACA;AACO,MAAMI,sBAAsB,CAA8B;EAC/DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,WAAW;EAChD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAAqB,EAAEO,OAA+B,EAAE;IACtE,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAACT,IAAI,CAAC;IAC1C,OAAO,KAAIU,sCAAiB,EAACF,QAAQ,EAAER,IAAI,CAACW,OAAO,CAAC,CAAC,CAAC;EACxD;AACF;AAACC,OAAA,CAAAd,sBAAA,GAAAA,sBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ModuleDeclarationTransformer","predicate","node","kind","ts","SyntaxKind","ModuleDeclaration","getIdentifiers","transform","context","location","getLocation","UnImplementedSchema","getText"],"sources":["module-declaration.ts"],"sourcesContent":["import ts, { Node, ModuleDeclaration } from 'typescript';\nimport { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class ModuleDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.ModuleDeclaration;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: ModuleDeclaration, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new UnImplementedSchema(location, node.getText(), ts.SyntaxKind[node.kind]);\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","ModuleDeclarationTransformer","predicate","node","kind","ts","SyntaxKind","ModuleDeclaration","getIdentifiers","transform","context","location","getLocation","UnImplementedSchema","getText","exports"],"sources":["module-declaration.ts"],"sourcesContent":["import ts, { Node, ModuleDeclaration } from 'typescript';\nimport { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class ModuleDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.ModuleDeclaration;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: ModuleDeclaration, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new UnImplementedSchema(location, node.getText(), ts.SyntaxKind[node.kind]);\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMI,4BAA4B,CAA8B;EACrEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,iBAAiB;EACtD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAAuB,EAAEO,OAA+B,EAAE;IACxE,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAACT,IAAI,CAAC;IAC1C,OAAO,KAAIU,wCAAmB,EAACF,QAAQ,EAAER,IAAI,CAACW,OAAO,CAAC,CAAC,EAAET,qBAAE,CAACC,UAAU,CAACH,IAAI,CAACC,IAAI,CAAC,CAAC;EACpF;AACF;AAACW,OAAA,CAAAd,4BAAA,GAAAA,4BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NamedTupleTransformer","predicate","node","kind","SyntaxKind","NamedTupleMember","getIdentifiers","transform","context","name","getText","location","getLocation","type","computeSchema","NamedTupleSchema"],"sources":["named-tuple.ts"],"sourcesContent":["import { Node, SyntaxKind, NamedTupleMember } from 'typescript';\nimport { NamedTupleSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class NamedTupleTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.NamedTupleMember;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: NamedTupleMember, context: SchemaExtractorContext) {\n const name = node.name.getText();\n const location = context.getLocation(node);\n const type = await context.computeSchema(node.type);\n return new NamedTupleSchema(location, type, name);\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","require","_semanticsEntities","NamedTupleTransformer","predicate","node","kind","SyntaxKind","NamedTupleMember","getIdentifiers","transform","context","name","getText","location","getLocation","type","computeSchema","NamedTupleSchema","exports"],"sources":["named-tuple.ts"],"sourcesContent":["import { Node, SyntaxKind, NamedTupleMember } from 'typescript';\nimport { NamedTupleSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class NamedTupleTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.NamedTupleMember;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: NamedTupleMember, context: SchemaExtractorContext) {\n const name = node.name.getText();\n const location = context.getLocation(node);\n const type = await context.computeSchema(node.type);\n return new NamedTupleSchema(location, type, name);\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMG,qBAAqB,CAA8B;EAC9DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,gBAAgB;EAClD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACL,IAAsB,EAAEM,OAA+B,EAAE;IACvE,MAAMC,IAAI,GAAGP,IAAI,CAACO,IAAI,CAACC,OAAO,CAAC,CAAC;IAChC,MAAMC,QAAQ,GAAGH,OAAO,CAACI,WAAW,CAACV,IAAI,CAAC;IAC1C,MAAMW,IAAI,GAAG,MAAML,OAAO,CAACM,aAAa,CAACZ,IAAI,CAACW,IAAI,CAAC;IACnD,OAAO,KAAIE,qCAAgB,EAACJ,QAAQ,EAAEE,IAAI,EAAEJ,IAAI,CAAC;EACnD;AACF;AAACO,OAAA,CAAAhB,qBAAA,GAAAA,qBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ParameterTransformer","predicate","node","kind","ts","SyntaxKind","Parameter","getIdentifiers","transform","context","ParameterSchema","getLocation","getName","getType","Boolean","questionToken","initializer","getText","undefined","getObjectBindingNodes","param","isIdentifier","name","elements","map","elem","elementsStr","join","ArrayBindingPattern","type","computeSchema","info","getQuickInfo","parsed","parseTypeFromQuickInfo","InferenceTypeSchema","pMapSeries","TupleTypeSchema","ObjectBindingPattern","TypeLiteralSchema","Error"],"sources":["parameter.ts"],"sourcesContent":["import ts, {\n BindingElement,\n isIdentifier,\n Node,\n ParameterDeclaration,\n SyntaxKind,\n ArrayBindingElement,\n} from 'typescript';\nimport {\n InferenceTypeSchema,\n ParameterSchema,\n SchemaNode,\n TupleTypeSchema,\n TypeLiteralSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport pMapSeries from 'p-map-series';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { parseTypeFromQuickInfo } from './utils/parse-type-from-quick-info';\nimport { Identifier } from '../identifier';\n\nexport class ParameterTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.Parameter;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: ParameterDeclaration, context: SchemaExtractorContext) {\n return new ParameterSchema(\n context.getLocation(node),\n this.getName(node),\n await this.getType(node, context),\n Boolean(node.questionToken),\n node.initializer ? node.initializer.getText() : undefined,\n undefined,\n await this.getObjectBindingNodes(node, context)\n );\n }\n\n getName(param: ParameterDeclaration): string {\n if (isIdentifier(param.name)) {\n return param.name.getText();\n }\n // it's binding pattern, either an array or an object\n const elements = param.name.elements.map((elem) => elem.getText());\n const elementsStr = elements.join(', ');\n if (param.name.kind === SyntaxKind.ArrayBindingPattern) {\n return `[ ${elementsStr} ]`;\n }\n // it's an object binding\n return `{ ${elementsStr} }`;\n }\n\n async getType(param: ParameterDeclaration, context: SchemaExtractorContext): Promise<SchemaNode> {\n if (param.type) {\n return context.computeSchema(param.type);\n }\n\n if (isIdentifier(param.name)) {\n const info = await context.getQuickInfo(param.name);\n const parsed = parseTypeFromQuickInfo(info);\n return new InferenceTypeSchema(context.getLocation(param), parsed);\n }\n // it's binding pattern, either an array or an object\n if (param.name.kind === SyntaxKind.ArrayBindingPattern) {\n const elements = await pMapSeries(param.name.elements, async (elem: ArrayBindingElement) => {\n const info = await context.getQuickInfo(elem);\n const parsed = parseTypeFromQuickInfo(info);\n return new InferenceTypeSchema(context.getLocation(param), parsed);\n });\n return new TupleTypeSchema(context.getLocation(param), elements);\n }\n if (param.name.kind === SyntaxKind.ObjectBindingPattern) {\n const elements = await pMapSeries(param.name.elements, async (elem: BindingElement) => {\n const info = await context.getQuickInfo(elem.name);\n const parsed = parseTypeFromQuickInfo(info);\n return new InferenceTypeSchema(context.getLocation(param), parsed, elem.name.getText());\n });\n return new TypeLiteralSchema(context.getLocation(param), elements);\n }\n throw new Error(`unknown param type`);\n }\n\n async getObjectBindingNodes(\n param: ParameterDeclaration,\n context: SchemaExtractorContext\n ): Promise<SchemaNode[] | undefined> {\n if (param.name.kind !== SyntaxKind.ObjectBindingPattern) return undefined;\n return pMapSeries(param.name.elements, async (elem: BindingElement) => {\n const info =\n elem.name.kind === SyntaxKind.ObjectBindingPattern ? undefined : await context.getQuickInfo(elem.name);\n // @todo look into extracting nested objected binding patters\n /**\n * apiNode: {\n api: {\n name,\n signature: defaultSignature,\n doc, \n location: { filePath },\n },\n },\n */\n const parsed = info ? parseTypeFromQuickInfo(info) : elem.getText();\n return new InferenceTypeSchema(context.getLocation(param), parsed, elem.name.getText());\n });\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","_interopRequireWildcard","require","_semanticsEntities","_pMapSeries","_interopRequireDefault","_parseTypeFromQuickInfo","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ParameterTransformer","predicate","node","kind","ts","SyntaxKind","Parameter","getIdentifiers","transform","context","ParameterSchema","getLocation","getName","getType","Boolean","questionToken","initializer","getText","undefined","getObjectBindingNodes","param","isIdentifier","name","elements","map","elem","elementsStr","join","ArrayBindingPattern","type","computeSchema","info","getQuickInfo","parsed","parseTypeFromQuickInfo","InferenceTypeSchema","pMapSeries","TupleTypeSchema","ObjectBindingPattern","TypeLiteralSchema","Error","exports"],"sources":["parameter.ts"],"sourcesContent":["import ts, {\n BindingElement,\n isIdentifier,\n Node,\n ParameterDeclaration,\n SyntaxKind,\n ArrayBindingElement,\n} from 'typescript';\nimport {\n InferenceTypeSchema,\n ParameterSchema,\n SchemaNode,\n TupleTypeSchema,\n TypeLiteralSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport pMapSeries from 'p-map-series';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { parseTypeFromQuickInfo } from './utils/parse-type-from-quick-info';\nimport { Identifier } from '../identifier';\n\nexport class ParameterTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.Parameter;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: ParameterDeclaration, context: SchemaExtractorContext) {\n return new ParameterSchema(\n context.getLocation(node),\n this.getName(node),\n await this.getType(node, context),\n Boolean(node.questionToken),\n node.initializer ? node.initializer.getText() : undefined,\n undefined,\n await this.getObjectBindingNodes(node, context)\n );\n }\n\n getName(param: ParameterDeclaration): string {\n if (isIdentifier(param.name)) {\n return param.name.getText();\n }\n // it's binding pattern, either an array or an object\n const elements = param.name.elements.map((elem) => elem.getText());\n const elementsStr = elements.join(', ');\n if (param.name.kind === SyntaxKind.ArrayBindingPattern) {\n return `[ ${elementsStr} ]`;\n }\n // it's an object binding\n return `{ ${elementsStr} }`;\n }\n\n async getType(param: ParameterDeclaration, context: SchemaExtractorContext): Promise<SchemaNode> {\n if (param.type) {\n return context.computeSchema(param.type);\n }\n\n if (isIdentifier(param.name)) {\n const info = await context.getQuickInfo(param.name);\n const parsed = parseTypeFromQuickInfo(info);\n return new InferenceTypeSchema(context.getLocation(param), parsed);\n }\n // it's binding pattern, either an array or an object\n if (param.name.kind === SyntaxKind.ArrayBindingPattern) {\n const elements = await pMapSeries(param.name.elements, async (elem: ArrayBindingElement) => {\n const info = await context.getQuickInfo(elem);\n const parsed = parseTypeFromQuickInfo(info);\n return new InferenceTypeSchema(context.getLocation(param), parsed);\n });\n return new TupleTypeSchema(context.getLocation(param), elements);\n }\n if (param.name.kind === SyntaxKind.ObjectBindingPattern) {\n const elements = await pMapSeries(param.name.elements, async (elem: BindingElement) => {\n const info = await context.getQuickInfo(elem.name);\n const parsed = parseTypeFromQuickInfo(info);\n return new InferenceTypeSchema(context.getLocation(param), parsed, elem.name.getText());\n });\n return new TypeLiteralSchema(context.getLocation(param), elements);\n }\n throw new Error(`unknown param type`);\n }\n\n async getObjectBindingNodes(\n param: ParameterDeclaration,\n context: SchemaExtractorContext\n ): Promise<SchemaNode[] | undefined> {\n if (param.name.kind !== SyntaxKind.ObjectBindingPattern) return undefined;\n return pMapSeries(param.name.elements, async (elem: BindingElement) => {\n const info =\n elem.name.kind === SyntaxKind.ObjectBindingPattern ? undefined : await context.getQuickInfo(elem.name);\n // @todo look into extracting nested objected binding patters\n /**\n * apiNode: {\n api: {\n name,\n signature: defaultSignature,\n doc, \n location: { filePath },\n },\n },\n */\n const parsed = info ? parseTypeFromQuickInfo(info) : elem.getText();\n return new InferenceTypeSchema(context.getLocation(param), parsed, elem.name.getText());\n });\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAAA,CAAAH,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAA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AAM,GAAG,IAAAC,gDAAsB,EAACH,IAAI,CAAC;QAC3C,OAAO,KAAII,wCAAmB,EAAC1B,OAAO,CAACE,WAAW,CAACS,KAAK,CAAC,EAAEa,MAAM,EAAER,IAAI,CAACH,IAAI,CAACL,OAAO,CAAC,CAAC,CAAC;MACzF,CAAC,CAAC;MACF,OAAO,KAAIsB,sCAAiB,EAAC9B,OAAO,CAACE,WAAW,CAACS,KAAK,CAAC,EAAEG,QAAQ,CAAC;IACpE;IACA,MAAM,IAAIiB,KAAK,CAAE,oBAAmB,CAAC;EACvC;EAEA,MAAMrB,qBAAqBA,CACzBC,KAA2B,EAC3BX,OAA+B,EACI;IACnC,IAAIW,KAAK,CAACE,IAAI,CAACnB,IAAI,KAAKE,wBAAU,CAACiC,oBAAoB,EAAE,OAAOpB,SAAS;IACzE,OAAO,IAAAkB,qBAAU,EAAChB,KAAK,CAACE,IAAI,CAACC,QAAQ,EAAE,MAAOE,IAAoB,IAAK;MACrE,MAAMM,IAAI,GACRN,IAAI,CAACH,IAAI,CAACnB,IAAI,KAAKE,wBAAU,CAACiC,oBAAoB,GAAGpB,SAAS,GAAG,MAAMT,OAAO,CAACuB,YAAY,CAACP,IAAI,CAACH,IAAI,CAAC;MACxG;MACA;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACM,MAAMW,MAAM,GAAGF,IAAI,GAAG,IAAAG,gDAAsB,EAACH,IAAI,CAAC,GAAGN,IAAI,CAACR,OAAO,CAAC,CAAC;MACnE,OAAO,KAAIkB,wCAAmB,EAAC1B,OAAO,CAACE,WAAW,CAACS,KAAK,CAAC,EAAEa,MAAM,EAAER,IAAI,CAACH,IAAI,CAACL,OAAO,CAAC,CAAC,CAAC;IACzF,CAAC,CAAC;EACJ;AACF;AAACwB,OAAA,CAAAzC,oBAAA,GAAAA,oBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ParenthesizedTypeTransformer","predicate","node","kind","SyntaxKind","ParenthesizedType","getIdentifiers","transform","context","type","computeSchema","ParenthesizedTypeSchema","getLocation"],"sources":["parenthesized-type.ts"],"sourcesContent":["import { Node, ParenthesizedTypeNode, SyntaxKind } from 'typescript';\nimport { ParenthesizedTypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class ParenthesizedTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ParenthesizedType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: ParenthesizedTypeNode, context: SchemaExtractorContext) {\n const type = await context.computeSchema(node.type);\n return new ParenthesizedTypeSchema(context.getLocation(node), type);\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","require","_semanticsEntities","ParenthesizedTypeTransformer","predicate","node","kind","SyntaxKind","ParenthesizedType","getIdentifiers","transform","context","type","computeSchema","ParenthesizedTypeSchema","getLocation","exports"],"sources":["parenthesized-type.ts"],"sourcesContent":["import { Node, ParenthesizedTypeNode, SyntaxKind } from 'typescript';\nimport { ParenthesizedTypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class ParenthesizedTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ParenthesizedType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: ParenthesizedTypeNode, context: SchemaExtractorContext) {\n const type = await context.computeSchema(node.type);\n return new ParenthesizedTypeSchema(context.getLocation(node), type);\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMG,4BAA4B,CAA8B;EACrEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,iBAAiB;EACnD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACL,IAA2B,EAAEM,OAA+B,EAAE;IAC5E,MAAMC,IAAI,GAAG,MAAMD,OAAO,CAACE,aAAa,CAACR,IAAI,CAACO,IAAI,CAAC;IACnD,OAAO,KAAIE,4CAAuB,EAACH,OAAO,CAACI,WAAW,CAACV,IAAI,CAAC,EAAEO,IAAI,CAAC;EACrE;AACF;AAACI,OAAA,CAAAb,4BAAA,GAAAA,4BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PropertyDeclarationTransformer","predicate","node","kind","SyntaxKind","PropertyDeclaration","PropertySignature","getIdentifiers","isComputedProperty","name","ComputedPropertyName","transform","context","getText","info","undefined","getQuickInfo","displaySig","body","displayString","typeStr","parseTypeFromQuickInfo","type","resolveType","isOptional","Boolean","questionToken","doc","jsDocToDocSchema","VariableLikeSchema","getLocation"],"sources":["property-declaration.ts"],"sourcesContent":["import { Node, PropertyDeclaration, PropertySignature, SyntaxKind } from 'typescript';\nimport { VariableLikeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { parseTypeFromQuickInfo } from './utils/parse-type-from-quick-info';\nimport { Identifier } from '../identifier';\n\nexport class PropertyDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n // [computedName]: string\n private isComputedProperty(node: PropertyDeclaration | PropertySignature) {\n return node.name.kind === SyntaxKind.ComputedPropertyName;\n }\n\n // @todo - handle arrow function objects\n async transform(node: PropertyDeclaration | PropertySignature, context: SchemaExtractorContext) {\n const name = node.name.getText();\n const info = this.isComputedProperty(node) ? undefined : await context.getQuickInfo(node.name);\n const displaySig = info?.body?.displayString || node.getText();\n const typeStr = parseTypeFromQuickInfo(info);\n const type = await context.resolveType(node, typeStr);\n const isOptional = Boolean(node.questionToken);\n const doc = await context.jsDocToDocSchema(node);\n return new VariableLikeSchema(context.getLocation(node), name, displaySig, type, isOptional, doc);\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","require","_semanticsEntities","_parseTypeFromQuickInfo","PropertyDeclarationTransformer","predicate","node","kind","SyntaxKind","PropertyDeclaration","PropertySignature","getIdentifiers","isComputedProperty","name","ComputedPropertyName","transform","context","_info$body","getText","info","undefined","getQuickInfo","displaySig","body","displayString","typeStr","parseTypeFromQuickInfo","type","resolveType","isOptional","Boolean","questionToken","doc","jsDocToDocSchema","VariableLikeSchema","getLocation","exports"],"sources":["property-declaration.ts"],"sourcesContent":["import { Node, PropertyDeclaration, PropertySignature, SyntaxKind } from 'typescript';\nimport { VariableLikeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { parseTypeFromQuickInfo } from './utils/parse-type-from-quick-info';\nimport { Identifier } from '../identifier';\n\nexport class PropertyDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n // [computedName]: string\n private isComputedProperty(node: PropertyDeclaration | PropertySignature) {\n return node.name.kind === SyntaxKind.ComputedPropertyName;\n }\n\n // @todo - handle arrow function objects\n async transform(node: PropertyDeclaration | PropertySignature, context: SchemaExtractorContext) {\n const name = node.name.getText();\n const info = this.isComputedProperty(node) ? undefined : await context.getQuickInfo(node.name);\n const displaySig = info?.body?.displayString || node.getText();\n const typeStr = parseTypeFromQuickInfo(info);\n const type = await context.resolveType(node, typeStr);\n const isOptional = Boolean(node.questionToken);\n const doc = await context.jsDocToDocSchema(node);\n return new VariableLikeSchema(context.getLocation(node), name, displaySig, type, isOptional, doc);\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,wBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,uBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,MAAMI,8BAA8B,CAA8B;EACvEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,mBAAmB,IAAIH,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACE,iBAAiB;EACnG;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;;EAEA;EACQC,kBAAkBA,CAACN,IAA6C,EAAE;IACxE,OAAOA,IAAI,CAACO,IAAI,CAACN,IAAI,KAAKC,wBAAU,CAACM,oBAAoB;EAC3D;;EAEA;EACA,MAAMC,SAASA,CAACT,IAA6C,EAAEU,OAA+B,EAAE;IAAA,IAAAC,UAAA;IAC9F,MAAMJ,IAAI,GAAGP,IAAI,CAACO,IAAI,CAACK,OAAO,CAAC,CAAC;IAChC,MAAMC,IAAI,GAAG,IAAI,CAACP,kBAAkB,CAACN,IAAI,CAAC,GAAGc,SAAS,GAAG,MAAMJ,OAAO,CAACK,YAAY,CAACf,IAAI,CAACO,IAAI,CAAC;IAC9F,MAAMS,UAAU,GAAG,CAAAH,IAAI,aAAJA,IAAI,wBAAAF,UAAA,GAAJE,IAAI,CAAEI,IAAI,cAAAN,UAAA,uBAAVA,UAAA,CAAYO,aAAa,KAAIlB,IAAI,CAACY,OAAO,CAAC,CAAC;IAC9D,MAAMO,OAAO,GAAG,IAAAC,gDAAsB,EAACP,IAAI,CAAC;IAC5C,MAAMQ,IAAI,GAAG,MAAMX,OAAO,CAACY,WAAW,CAACtB,IAAI,EAAEmB,OAAO,CAAC;IACrD,MAAMI,UAAU,GAAGC,OAAO,CAACxB,IAAI,CAACyB,aAAa,CAAC;IAC9C,MAAMC,GAAG,GAAG,MAAMhB,OAAO,CAACiB,gBAAgB,CAAC3B,IAAI,CAAC;IAChD,OAAO,KAAI4B,uCAAkB,EAAClB,OAAO,CAACmB,WAAW,CAAC7B,IAAI,CAAC,EAAEO,IAAI,EAAES,UAAU,EAAEK,IAAI,EAAEE,UAAU,EAAEG,GAAG,CAAC;EACnG;AACF;AAACI,OAAA,CAAAhC,8BAAA,GAAAA,8BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SetAccessorTransformer","predicate","node","kind","ts","SyntaxKind","SetAccessor","getIdentifiers","transform","context","params","pMapSeries","parameters","param","computeSchema","displaySig","getQuickInfoDisplayString","name","SetAccessorSchema","getLocation","getText"],"sources":["set-accessor.ts"],"sourcesContent":["import ts, { Node, SetAccessorDeclaration } from 'typescript';\nimport { ParameterSchema, SetAccessorSchema } from '@teambit/semantics.entities.semantic-schema';\nimport pMapSeries from 'p-map-series';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class SetAccessorTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.SetAccessor;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: SetAccessorDeclaration, context: SchemaExtractorContext) {\n const params = (await pMapSeries(node.parameters, async (param) =>\n context.computeSchema(param)\n )) as ParameterSchema[];\n\n const displaySig = await context.getQuickInfoDisplayString(node.name);\n return new SetAccessorSchema(context.getLocation(node), node.name.getText(), params[0], displaySig);\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","_pMapSeries","SetAccessorTransformer","predicate","node","kind","ts","SyntaxKind","SetAccessor","getIdentifiers","transform","context","params","pMapSeries","parameters","param","computeSchema","displaySig","getQuickInfoDisplayString","name","SetAccessorSchema","getLocation","getText","exports"],"sources":["set-accessor.ts"],"sourcesContent":["import ts, { Node, SetAccessorDeclaration } from 'typescript';\nimport { ParameterSchema, SetAccessorSchema } from '@teambit/semantics.entities.semantic-schema';\nimport pMapSeries from 'p-map-series';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class SetAccessorTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.SetAccessor;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: SetAccessorDeclaration, context: SchemaExtractorContext) {\n const params = (await pMapSeries(node.parameters, async (param) =>\n context.computeSchema(param)\n )) as ParameterSchema[];\n\n const displaySig = await context.getQuickInfoDisplayString(node.name);\n return new SetAccessorSchema(context.getLocation(node), node.name.getText(), params[0], displaySig);\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMK,sBAAsB,CAA8B;EAC/DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,WAAW;EAChD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAA4B,EAAEO,OAA+B,EAAE;IAC7E,MAAMC,MAAM,GAAI,MAAM,IAAAC,qBAAU,EAACT,IAAI,CAACU,UAAU,EAAE,MAAOC,KAAK,IAC5DJ,OAAO,CAACK,aAAa,CAACD,KAAK,CAC7B,CAAuB;IAEvB,MAAME,UAAU,GAAG,MAAMN,OAAO,CAACO,yBAAyB,CAACd,IAAI,CAACe,IAAI,CAAC;IACrE,OAAO,KAAIC,sCAAiB,EAACT,OAAO,CAACU,WAAW,CAACjB,IAAI,CAAC,EAAEA,IAAI,CAACe,IAAI,CAACG,OAAO,CAAC,CAAC,EAAEV,MAAM,CAAC,CAAC,CAAC,EAAEK,UAAU,CAAC;EACrG;AACF;AAACM,OAAA,CAAArB,sBAAA,GAAAA,sBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SourceFileTransformer","predicate","node","kind","ts","SyntaxKind","SourceFile","getIdentifiers","sourceFile","context","exports","listExports","internals","listInternalNodes","exportIdentifiers","flatten","pMapSeries","reduce","acc","current","item","find","exportIdentifier","isEqual","push","ExportIdentifier","id","filePath","aliasId","sourceFilePath","internalIdentifiers","internalIdentifier","identifiers","transform","filter","internal","ImportDeclaration","exportDeclarations","exportNode","computeSchema","internalDeclarations","internalNode","ModuleSchema","getLocation","ast","statements","statement","ExportDeclaration","ExportAssignment","isExport","Boolean","modifiers","modifier","ExportKeyword"],"sources":["source-file-transformer.ts"],"sourcesContent":["import ts, { Node, SourceFile } from 'typescript';\nimport { flatten } from 'lodash';\nimport pMapSeries from 'p-map-series';\nimport { ModuleSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { ExportIdentifier } from '../export-identifier';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class SourceFileTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.SourceFile;\n }\n\n async getIdentifiers(sourceFile: SourceFile, context: SchemaExtractorContext) {\n const exports = this.listExports(sourceFile);\n const internals = this.listInternalNodes(sourceFile);\n\n // change to pMap series\n const exportIdentifiers = flatten(\n await pMapSeries(exports, (node) => {\n return context.getIdentifiers(node);\n })\n ).reduce<ExportIdentifier[]>((acc, current) => {\n const item = acc.find((exportIdentifier) => exportIdentifier.isEqual(current));\n if (!item) acc.push(new ExportIdentifier(current.id, current.filePath, current.aliasId, current.sourceFilePath));\n return acc;\n }, []);\n\n const internalIdentifiers = flatten(\n await pMapSeries(internals, (node) => {\n return context.getIdentifiers(node);\n })\n ).reduce<Identifier[]>((acc, current) => {\n const item = acc.find((internalIdentifier) => internalIdentifier.isEqual(current));\n if (!item) acc.push(current);\n return acc;\n }, []);\n\n const identifiers = [...exportIdentifiers, ...internalIdentifiers];\n\n return identifiers;\n }\n\n async transform(node: SourceFile, context: SchemaExtractorContext) {\n const exports = this.listExports(node);\n const internals = this.listInternalNodes(node).filter(\n (internal) => internal.kind !== ts.SyntaxKind.ImportDeclaration\n );\n\n const exportDeclarations = await pMapSeries(exports, (exportNode) => {\n return context.computeSchema(exportNode);\n });\n\n const internalDeclarations = await pMapSeries(internals, (internalNode) => {\n return context.computeSchema(internalNode);\n });\n\n return new ModuleSchema(context.getLocation(node), exportDeclarations, internalDeclarations);\n }\n\n /**\n * list all exports of a source file.\n */\n private listExports(ast: SourceFile): Node[] {\n return ast.statements.filter((statement) => {\n if (statement.kind === ts.SyntaxKind.ExportDeclaration || statement.kind === ts.SyntaxKind.ExportAssignment)\n return true;\n const isExport = Boolean(\n statement.modifiers?.find((modifier) => {\n return modifier.kind === ts.SyntaxKind.ExportKeyword;\n })\n );\n return isExport;\n });\n }\n\n private listInternalNodes(ast: SourceFile): Node[] {\n return ast.statements.filter((statement) => {\n if (\n !(statement.kind === ts.SyntaxKind.ExportDeclaration || statement.kind === ts.SyntaxKind.ExportAssignment) &&\n !statement.modifiers?.find((modifier) => {\n return modifier.kind === ts.SyntaxKind.ExportKeyword;\n })\n ) {\n return true;\n }\n\n return false;\n });\n }\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","_interopRequireDefault","require","_lodash","_pMapSeries","_semanticsEntities","_exportIdentifier","SourceFileTransformer","predicate","node","kind","ts","SyntaxKind","SourceFile","getIdentifiers","sourceFile","context","exports","listExports","internals","listInternalNodes","exportIdentifiers","flatten","pMapSeries","reduce","acc","current","item","find","exportIdentifier","isEqual","push","ExportIdentifier","id","filePath","aliasId","sourceFilePath","internalIdentifiers","internalIdentifier","identifiers","transform","filter","internal","ImportDeclaration","exportDeclarations","exportNode","computeSchema","internalDeclarations","internalNode","ModuleSchema","getLocation","ast","statements","statement","_statement$modifiers","ExportDeclaration","ExportAssignment","isExport","Boolean","modifiers","modifier","ExportKeyword","_statement$modifiers2"],"sources":["source-file-transformer.ts"],"sourcesContent":["import ts, { Node, SourceFile } from 'typescript';\nimport { flatten } from 'lodash';\nimport pMapSeries from 'p-map-series';\nimport { ModuleSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { ExportIdentifier } from '../export-identifier';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class SourceFileTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.SourceFile;\n }\n\n async getIdentifiers(sourceFile: SourceFile, context: SchemaExtractorContext) {\n const exports = this.listExports(sourceFile);\n const internals = this.listInternalNodes(sourceFile);\n\n // change to pMap series\n const exportIdentifiers = flatten(\n await pMapSeries(exports, (node) => {\n return context.getIdentifiers(node);\n })\n ).reduce<ExportIdentifier[]>((acc, current) => {\n const item = acc.find((exportIdentifier) => exportIdentifier.isEqual(current));\n if (!item) acc.push(new ExportIdentifier(current.id, current.filePath, current.aliasId, current.sourceFilePath));\n return acc;\n }, []);\n\n const internalIdentifiers = flatten(\n await pMapSeries(internals, (node) => {\n return context.getIdentifiers(node);\n })\n ).reduce<Identifier[]>((acc, current) => {\n const item = acc.find((internalIdentifier) => internalIdentifier.isEqual(current));\n if (!item) acc.push(current);\n return acc;\n }, []);\n\n const identifiers = [...exportIdentifiers, ...internalIdentifiers];\n\n return identifiers;\n }\n\n async transform(node: SourceFile, context: SchemaExtractorContext) {\n const exports = this.listExports(node);\n const internals = this.listInternalNodes(node).filter(\n (internal) => internal.kind !== ts.SyntaxKind.ImportDeclaration\n );\n\n const exportDeclarations = await pMapSeries(exports, (exportNode) => {\n return context.computeSchema(exportNode);\n });\n\n const internalDeclarations = await pMapSeries(internals, (internalNode) => {\n return context.computeSchema(internalNode);\n });\n\n return new ModuleSchema(context.getLocation(node), exportDeclarations, internalDeclarations);\n }\n\n /**\n * list all exports of a source file.\n */\n private listExports(ast: SourceFile): Node[] {\n return ast.statements.filter((statement) => {\n if (statement.kind === ts.SyntaxKind.ExportDeclaration || statement.kind === ts.SyntaxKind.ExportAssignment)\n return true;\n const isExport = Boolean(\n statement.modifiers?.find((modifier) => {\n return modifier.kind === ts.SyntaxKind.ExportKeyword;\n })\n );\n return isExport;\n });\n }\n\n private listInternalNodes(ast: SourceFile): Node[] {\n return ast.statements.filter((statement) => {\n if (\n !(statement.kind === ts.SyntaxKind.ExportDeclaration || statement.kind === ts.SyntaxKind.ExportAssignment) &&\n !statement.modifiers?.find((modifier) => {\n return modifier.kind === ts.SyntaxKind.ExportKeyword;\n })\n ) {\n return true;\n }\n\n return false;\n });\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,mBAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,kBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,kBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,iBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIO,MAAMO,qBAAqB,CAA8B;EAC9DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,UAAU;EAC/C;EAEA,MAAMC,cAAcA,CAACC,UAAsB,EAAEC,OAA+B,EAAE;IAC5E,MAAMC,OAAO,GAAG,IAAI,CAACC,WAAW,CAACH,UAAU,CAAC;IAC5C,MAAMI,SAAS,GAAG,IAAI,CAACC,iBAAiB,CAACL,UAAU,CAAC;;IAEpD;IACA,MAAMM,iBAA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UAAU,CAACX,MAAM,CAAEY,SAAS,IAAK;MAAA,IAAAS,qBAAA;MAC1C,IACE,EAAET,SAAS,CAAC3C,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAAC2C,iBAAiB,IAAIF,SAAS,CAAC3C,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAAC4C,gBAAgB,CAAC,IAC1G,GAAAM,qBAAA,GAACT,SAAS,CAACM,SAAS,cAAAG,qBAAA,eAAnBA,qBAAA,CAAqBlC,IAAI,CAAEgC,QAAQ,IAAK;QACvC,OAAOA,QAAQ,CAAClD,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACiD,aAAa;MACtD,CAAC,CAAC,GACF;QACA,OAAO,IAAI;MACb;MAEA,OAAO,KAAK;IACd,CAAC,CAAC;EACJ;AACF;AAAC5C,OAAA,CAAAV,qBAAA,GAAAA,qBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TemplateLiteralTypeSpanTransformer","predicate","node","kind","SyntaxKind","TemplateLiteralTypeSpan","getIdentifiers","transform","context","type","computeSchema","literal","text","TemplateLiteralTypeSpanSchema","getLocation"],"sources":["template-literal-type-span.ts"],"sourcesContent":["import { Node, SyntaxKind, TemplateLiteralTypeSpan } from 'typescript';\nimport { TemplateLiteralTypeSpanSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class TemplateLiteralTypeSpanTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.TemplateLiteralTypeSpan;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: TemplateLiteralTypeSpan, context: SchemaExtractorContext) {\n const type = await context.computeSchema(node.type);\n const literal = node.literal.text;\n return new TemplateLiteralTypeSpanSchema(context.getLocation(node), literal, type);\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","require","_semanticsEntities","TemplateLiteralTypeSpanTransformer","predicate","node","kind","SyntaxKind","TemplateLiteralTypeSpan","getIdentifiers","transform","context","type","computeSchema","literal","text","TemplateLiteralTypeSpanSchema","getLocation","exports"],"sources":["template-literal-type-span.ts"],"sourcesContent":["import { Node, SyntaxKind, TemplateLiteralTypeSpan } from 'typescript';\nimport { TemplateLiteralTypeSpanSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class TemplateLiteralTypeSpanTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.TemplateLiteralTypeSpan;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: TemplateLiteralTypeSpan, context: SchemaExtractorContext) {\n const type = await context.computeSchema(node.type);\n const literal = node.literal.text;\n return new TemplateLiteralTypeSpanSchema(context.getLocation(node), literal, type);\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMG,kCAAkC,CAA8B;EAC3EC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,uBAAuB;EACzD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACL,IAA6B,EAAEM,OAA+B,EAAE;IAC9E,MAAMC,IAAI,GAAG,MAAMD,OAAO,CAACE,aAAa,CAACR,IAAI,CAACO,IAAI,CAAC;IACnD,MAAME,OAAO,GAAGT,IAAI,CAACS,OAAO,CAACC,IAAI;IACjC,OAAO,KAAIC,kDAA6B,EAACL,OAAO,CAACM,WAAW,CAACZ,IAAI,CAAC,EAAES,OAAO,EAAEF,IAAI,CAAC;EACpF;AACF;AAACM,OAAA,CAAAf,kCAAA,GAAAA,kCAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TemplateLiteralTypeTransformer","predicate","node","kind","SyntaxKind","TemplateLiteralType","getIdentifiers","transform","context","templateSpans","pMapSeries","span","computeSchema","head","text","TemplateLiteralTypeSchema","getLocation"],"sources":["template-literal-type.ts"],"sourcesContent":["import { Node, SyntaxKind, TemplateLiteralTypeNode } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport { TemplateLiteralTypeSchema, TemplateLiteralTypeSpanSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class TemplateLiteralTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.TemplateLiteralType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: TemplateLiteralTypeNode, context: SchemaExtractorContext) {\n const templateSpans = (await pMapSeries(node.templateSpans, (span) =>\n context.computeSchema(span)\n )) as TemplateLiteralTypeSpanSchema[];\n const head = node.head.text;\n return new TemplateLiteralTypeSchema(context.getLocation(node), head, templateSpans);\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","require","_pMapSeries","_interopRequireDefault","_semanticsEntities","TemplateLiteralTypeTransformer","predicate","node","kind","SyntaxKind","TemplateLiteralType","getIdentifiers","transform","context","templateSpans","pMapSeries","span","computeSchema","head","text","TemplateLiteralTypeSchema","getLocation","exports"],"sources":["template-literal-type.ts"],"sourcesContent":["import { Node, SyntaxKind, TemplateLiteralTypeNode } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport { TemplateLiteralTypeSchema, TemplateLiteralTypeSpanSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class TemplateLiteralTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.TemplateLiteralType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: TemplateLiteralTypeNode, context: SchemaExtractorContext) {\n const templateSpans = (await pMapSeries(node.templateSpans, (span) =>\n context.computeSchema(span)\n )) as TemplateLiteralTypeSpanSchema[];\n const head = node.head.text;\n return new TemplateLiteralTypeSchema(context.getLocation(node), head, templateSpans);\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,mBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,kBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMK,8BAA8B,CAA8B;EACvEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,mBAAmB;EACrD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACL,IAA6B,EAAEM,OAA+B,EAAE;IAC9E,MAAMC,aAAa,GAAI,MAAM,IAAAC,qBAAU,EAACR,IAAI,CAACO,aAAa,EAAGE,IAAI,IAC/DH,OAAO,CAACI,aAAa,CAACD,IAAI,CAC5B,CAAqC;IACrC,MAAME,IAAI,GAAGX,IAAI,CAACW,IAAI,CAACC,IAAI;IAC3B,OAAO,KAAIC,8CAAyB,EAACP,OAAO,CAACQ,WAAW,CAACd,IAAI,CAAC,EAAEW,IAAI,EAAEJ,aAAa,CAAC;EACtF;AACF;AAACQ,OAAA,CAAAjB,8BAAA,GAAAA,8BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ThisTypeTransformer","predicate","node","kind","SyntaxKind","ThisType","getIdentifiers","transform","context","ThisTypeSchema","getLocation"],"sources":["this-type.ts"],"sourcesContent":["import { Node, SyntaxKind, ThisTypeNode } from 'typescript';\nimport { ThisTypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class ThisTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ThisType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: ThisTypeNode, context: SchemaExtractorContext) {\n return new ThisTypeSchema(context.getLocation(node));\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","require","_semanticsEntities","ThisTypeTransformer","predicate","node","kind","SyntaxKind","ThisType","getIdentifiers","transform","context","ThisTypeSchema","getLocation","exports"],"sources":["this-type.ts"],"sourcesContent":["import { Node, SyntaxKind, ThisTypeNode } from 'typescript';\nimport { ThisTypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class ThisTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ThisType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: ThisTypeNode, context: SchemaExtractorContext) {\n return new ThisTypeSchema(context.getLocation(node));\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMG,mBAAmB,CAA8B;EAC5DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,QAAQ;EAC1C;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACL,IAAkB,EAAEM,OAA+B,EAAE;IACnE,OAAO,KAAIC,mCAAc,EAACD,OAAO,CAACE,WAAW,CAACR,IAAI,CAAC,CAAC;EACtD;AACF;AAACS,OAAA,CAAAX,mBAAA,GAAAA,mBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TupleTypeTransformer","predicate","node","kind","SyntaxKind","TupleType","getIdentifiers","transform","context","elements","pMapSeries","elem","typeSchema","computeSchema","TupleTypeSchema","getLocation"],"sources":["tuple-type.ts"],"sourcesContent":["import { Node, SyntaxKind, TupleTypeNode } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport { TupleTypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class TupleTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.TupleType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: TupleTypeNode, context: SchemaExtractorContext) {\n const elements = await pMapSeries(node.elements, async (elem) => {\n const typeSchema = await context.computeSchema(elem);\n return typeSchema;\n });\n return new TupleTypeSchema(context.getLocation(node), elements);\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","require","_pMapSeries","_interopRequireDefault","_semanticsEntities","TupleTypeTransformer","predicate","node","kind","SyntaxKind","TupleType","getIdentifiers","transform","context","elements","pMapSeries","elem","typeSchema","computeSchema","TupleTypeSchema","getLocation","exports"],"sources":["tuple-type.ts"],"sourcesContent":["import { Node, SyntaxKind, TupleTypeNode } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport { TupleTypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class TupleTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.TupleType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: TupleTypeNode, context: SchemaExtractorContext) {\n const elements = await pMapSeries(node.elements, async (elem) => {\n const typeSchema = await context.computeSchema(elem);\n return typeSchema;\n });\n return new TupleTypeSchema(context.getLocation(node), elements);\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,mBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,kBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMK,oBAAoB,CAA8B;EAC7DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,SAAS;EAC3C;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACL,IAAmB,EAAEM,OAA+B,EAAE;IACpE,MAAMC,QAAQ,GAAG,MAAM,IAAAC,qBAAU,EAACR,IAAI,CAACO,QAAQ,EAAE,MAAOE,IAAI,IAAK;MAC/D,MAAMC,UAAU,GAAG,MAAMJ,OAAO,CAACK,aAAa,CAACF,IAAI,CAAC;MACpD,OAAOC,UAAU;IACnB,CAAC,CAAC;IACF,OAAO,KAAIE,oCAAe,EAACN,OAAO,CAACO,WAAW,CAACb,IAAI,CAAC,EAAEO,QAAQ,CAAC;EACjE;AACF;AAACO,OAAA,CAAAhB,oBAAA,GAAAA,oBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TypeAliasTransformer","predicate","node","kind","ts","SyntaxKind","TypeAliasDeclaration","getIdentifiers","Identifier","name","getText","getSourceFile","fileName","getName","transform","typeAlias","context","type","computeSchema","displaySig","getQuickInfoDisplayString","doc","jsDocToDocSchema","TypeSchema","getLocation"],"sources":["type-alias.ts"],"sourcesContent":["import ts, { Node, TypeAliasDeclaration } from 'typescript';\nimport { TypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class TypeAliasTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.TypeAliasDeclaration;\n }\n\n async getIdentifiers(node: TypeAliasDeclaration) {\n return [new Identifier(node.name.getText(), node.getSourceFile().fileName)];\n }\n\n private getName(node: TypeAliasDeclaration): string {\n return node.name.getText();\n }\n\n async transform(typeAlias: TypeAliasDeclaration, context: SchemaExtractorContext) {\n const type = await context.computeSchema(typeAlias.type);\n const displaySig = await context.getQuickInfoDisplayString(typeAlias.name);\n const doc = await context.jsDocToDocSchema(typeAlias);\n return new TypeSchema(context.getLocation(typeAlias), this.getName(typeAlias), type, displaySig, doc);\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","_identifier","TypeAliasTransformer","predicate","node","kind","ts","SyntaxKind","TypeAliasDeclaration","getIdentifiers","Identifier","name","getText","getSourceFile","fileName","getName","transform","typeAlias","context","type","computeSchema","displaySig","getQuickInfoDisplayString","doc","jsDocToDocSchema","TypeSchema","getLocation","exports"],"sources":["type-alias.ts"],"sourcesContent":["import ts, { Node, TypeAliasDeclaration } from 'typescript';\nimport { TypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class TypeAliasTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.TypeAliasDeclaration;\n }\n\n async getIdentifiers(node: TypeAliasDeclaration) {\n return [new Identifier(node.name.getText(), node.getSourceFile().fileName)];\n }\n\n private getName(node: TypeAliasDeclaration): string {\n return node.name.getText();\n }\n\n async transform(typeAlias: TypeAliasDeclaration, context: SchemaExtractorContext) {\n const type = await context.computeSchema(typeAlias.type);\n const displaySig = await context.getQuickInfoDisplayString(typeAlias.name);\n const doc = await context.jsDocToDocSchema(typeAlias);\n return new TypeSchema(context.getLocation(typeAlias), this.getName(typeAlias), type, displaySig, doc);\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;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["TypeLiteralTransformer","predicate","node","kind","ts","SyntaxKind","TypeLiteral","getIdentifiers","transform","context","members","pMapSeries","member","computeSchema","location","getLocation","TypeLiteralSchema"],"sources":["type-literal.ts"],"sourcesContent":["import ts, { Node, TypeLiteralNode } from 'typescript';\nimport { TypeLiteralSchema } from '@teambit/semantics.entities.semantic-schema';\nimport pMapSeries from 'p-map-series';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\n/**\n * not to be confused with \"LiteralType\", which is string/boolean/null.\n * this \"TypeLiteral\" is an object with properties, such as: `{ a: string; b: number }`, similar to Interface.\n */\nexport class TypeLiteralTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.TypeLiteral;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: TypeLiteralNode, context: SchemaExtractorContext) {\n const members = await pMapSeries(node.members, (member) => context.computeSchema(member));\n const location = context.getLocation(node);\n return new TypeLiteralSchema(location, members);\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","_pMapSeries","TypeLiteralTransformer","predicate","node","kind","ts","SyntaxKind","TypeLiteral","getIdentifiers","transform","context","members","pMapSeries","member","computeSchema","location","getLocation","TypeLiteralSchema","exports"],"sources":["type-literal.ts"],"sourcesContent":["import ts, { Node, TypeLiteralNode } from 'typescript';\nimport { TypeLiteralSchema } from '@teambit/semantics.entities.semantic-schema';\nimport pMapSeries from 'p-map-series';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\n/**\n * not to be confused with \"LiteralType\", which is string/boolean/null.\n * this \"TypeLiteral\" is an object with properties, such as: `{ a: string; b: number }`, similar to Interface.\n */\nexport class TypeLiteralTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.TypeLiteral;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: TypeLiteralNode, context: SchemaExtractorContext) {\n const members = await pMapSeries(node.members, (member) => context.computeSchema(member));\n const location = context.getLocation(node);\n return new TypeLiteralSchema(location, members);\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA;AACA;AACA;AACA;AACO,MAAMK,sBAAsB,CAA8B;EAC/DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,WAAW;EAChD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAAqB,EAAEO,OAA+B,EAAE;IACtE,MAAMC,OAAO,GAAG,MAAM,IAAAC,qBAAU,EAACT,IAAI,CAACQ,OAAO,EAAGE,MAAM,IAAKH,OAAO,CAACI,aAAa,CAACD,MAAM,CAAC,CAAC;IACzF,MAAME,QAAQ,GAAGL,OAAO,CAACM,WAAW,CAACb,IAAI,CAAC;IAC1C,OAAO,KAAIc,sCAAiB,EAACF,QAAQ,EAAEJ,OAAO,CAAC;EACjD;AACF;AAACO,OAAA,CAAAjB,sBAAA,GAAAA,sBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TypeOperatorTransformer","predicate","node","kind","SyntaxKind","TypeOperator","getIdentifiers","transform","context","operatorName","getOperatorName","operator","type","computeSchema","TypeOperatorSchema","getLocation","KeyOfKeyword","UniqueKeyword","ReadonlyKeyword","Error"],"sources":["type-operator.ts"],"sourcesContent":["import { Node, TypeOperatorNode, SyntaxKind } from 'typescript';\nimport { TypeOperatorSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\n/**\n * e.g. keyof typeof Foo\n */\nexport class TypeOperatorTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.TypeOperator;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: TypeOperatorNode, context: SchemaExtractorContext) {\n const operatorName = this.getOperatorName(node.operator);\n const type = await context.computeSchema(node.type);\n return new TypeOperatorSchema(context.getLocation(node), operatorName, type);\n }\n\n getOperatorName(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword) {\n switch (operator) {\n case SyntaxKind.KeyOfKeyword:\n return 'keyof';\n case SyntaxKind.UniqueKeyword:\n return 'unique';\n case SyntaxKind.ReadonlyKeyword:\n return 'readonly';\n default:\n throw new Error(`getOperatorName: unable to find operator name for ${operator}`);\n }\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","require","_semanticsEntities","TypeOperatorTransformer","predicate","node","kind","SyntaxKind","TypeOperator","getIdentifiers","transform","context","operatorName","getOperatorName","operator","type","computeSchema","TypeOperatorSchema","getLocation","KeyOfKeyword","UniqueKeyword","ReadonlyKeyword","Error","exports"],"sources":["type-operator.ts"],"sourcesContent":["import { Node, TypeOperatorNode, SyntaxKind } from 'typescript';\nimport { TypeOperatorSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\n/**\n * e.g. keyof typeof Foo\n */\nexport class TypeOperatorTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.TypeOperator;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: TypeOperatorNode, context: SchemaExtractorContext) {\n const operatorName = this.getOperatorName(node.operator);\n const type = await context.computeSchema(node.type);\n return new TypeOperatorSchema(context.getLocation(node), operatorName, type);\n }\n\n getOperatorName(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword) {\n switch (operator) {\n case SyntaxKind.KeyOfKeyword:\n return 'keyof';\n case SyntaxKind.UniqueKeyword:\n return 'unique';\n case SyntaxKind.ReadonlyKeyword:\n return 'readonly';\n default:\n throw new Error(`getOperatorName: unable to find operator name for ${operator}`);\n }\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA;AACA;AACA;AACO,MAAMG,uBAAuB,CAA8B;EAChEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,YAAY;EAC9C;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACL,IAAsB,EAAEM,OAA+B,EAAE;IACvE,MAAMC,YAAY,GAAG,IAAI,CAACC,eAAe,CAACR,IAAI,CAACS,QAAQ,CAAC;IACxD,MAAMC,IAAI,GAAG,MAAMJ,OAAO,CAACK,aAAa,CAACX,IAAI,CAACU,IAAI,CAAC;IACnD,OAAO,KAAIE,uCAAkB,EAACN,OAAO,CAACO,WAAW,CAACb,IAAI,CAAC,EAAEO,YAAY,EAAEG,IAAI,CAAC;EAC9E;EAEAF,eAAeA,CAACC,QAAyF,EAAE;IACzG,QAAQA,QAAQ;MACd,KAAKP,wBAAU,CAACY,YAAY;QAC1B,OAAO,OAAO;MAChB,KAAKZ,wBAAU,CAACa,aAAa;QAC3B,OAAO,QAAQ;MACjB,KAAKb,wBAAU,CAACc,eAAe;QAC7B,OAAO,UAAU;MACnB;QACE,MAAM,IAAIC,KAAK,CAAE,qDAAoDR,QAAS,EAAC,CAAC;IACpF;EACF;AACF;AAACS,OAAA,CAAApB,uBAAA,GAAAA,uBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TypePredicateTransformer","predicate","node","kind","SyntaxKind","TypePredicate","getIdentifiers","transform","context","parameterName","isIdentifier","getText","type","computeSchema","undefined","hasAssertsModifier","Boolean","assertsModifier","TypePredicateSchema","getLocation"],"sources":["type-predicate.ts"],"sourcesContent":["import { isIdentifier, Node, SyntaxKind, TypePredicateNode } from 'typescript';\nimport { TypePredicateSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class TypePredicateTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.TypePredicate;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: TypePredicateNode, context: SchemaExtractorContext) {\n const parameterName = isIdentifier(node.parameterName) ? node.parameterName.getText() : 'this';\n const type = node.type ? await context.computeSchema(node.type) : undefined;\n const hasAssertsModifier = Boolean(node.assertsModifier);\n return new TypePredicateSchema(context.getLocation(node), parameterName, type, hasAssertsModifier);\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","require","_semanticsEntities","TypePredicateTransformer","predicate","node","kind","SyntaxKind","TypePredicate","getIdentifiers","transform","context","parameterName","isIdentifier","getText","type","computeSchema","undefined","hasAssertsModifier","Boolean","assertsModifier","TypePredicateSchema","getLocation","exports"],"sources":["type-predicate.ts"],"sourcesContent":["import { isIdentifier, Node, SyntaxKind, TypePredicateNode } from 'typescript';\nimport { TypePredicateSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class TypePredicateTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.TypePredicate;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: TypePredicateNode, context: SchemaExtractorContext) {\n const parameterName = isIdentifier(node.parameterName) ? node.parameterName.getText() : 'this';\n const type = node.type ? await context.computeSchema(node.type) : undefined;\n const hasAssertsModifier = Boolean(node.assertsModifier);\n return new TypePredicateSchema(context.getLocation(node), parameterName, type, hasAssertsModifier);\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMG,wBAAwB,CAA8B;EACjEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,aAAa;EAC/C;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACL,IAAuB,EAAEM,OAA+B,EAAE;IACxE,MAAMC,aAAa,GAAG,IAAAC,0BAAY,EAACR,IAAI,CAACO,aAAa,CAAC,GAAGP,IAAI,CAACO,aAAa,CAACE,OAAO,CAAC,CAAC,GAAG,MAAM;IAC9F,MAAMC,IAAI,GAAGV,IAAI,CAACU,IAAI,GAAG,MAAMJ,OAAO,CAACK,aAAa,CAACX,IAAI,CAACU,IAAI,CAAC,GAAGE,SAAS;IAC3E,MAAMC,kBAAkB,GAAGC,OAAO,CAACd,IAAI,CAACe,eAAe,CAAC;IACxD,OAAO,KAAIC,wCAAmB,EAACV,OAAO,CAACW,WAAW,CAACjB,IAAI,CAAC,EAAEO,aAAa,EAAEG,IAAI,EAAEG,kBAAkB,CAAC;EACpG;AACF;AAACK,OAAA,CAAApB,wBAAA,GAAAA,wBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TypeQueryTransformer","predicate","node","kind","ts","SyntaxKind","TypeQuery","getIdentifiers","transform","context","displaySig","getQuickInfoDisplayString","exprName","type","resolveType","getText","location","getLocation","TypeQuerySchema"],"sources":["type-query.ts"],"sourcesContent":["import ts, { Node, TypeQueryNode } from 'typescript';\nimport { TypeQuerySchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\n/**\n * e.g. `typeof Foo`\n */\nexport class TypeQueryTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.TypeQuery;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: TypeQueryNode, context: SchemaExtractorContext) {\n const displaySig = await context.getQuickInfoDisplayString(node.exprName);\n const type = await context.resolveType(node.exprName, node.exprName.getText(), false);\n const location = context.getLocation(node);\n return new TypeQuerySchema(location, type, displaySig);\n }\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","TypeQueryTransformer","predicate","node","kind","ts","SyntaxKind","TypeQuery","getIdentifiers","transform","context","displaySig","getQuickInfoDisplayString","exprName","type","resolveType","getText","location","getLocation","TypeQuerySchema","exports"],"sources":["type-query.ts"],"sourcesContent":["import ts, { Node, TypeQueryNode } from 'typescript';\nimport { TypeQuerySchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\n/**\n * e.g. `typeof Foo`\n */\nexport class TypeQueryTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.TypeQuery;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: TypeQueryNode, context: SchemaExtractorContext) {\n const displaySig = await context.getQuickInfoDisplayString(node.exprName);\n const type = await context.resolveType(node.exprName, node.exprName.getText(), false);\n const location = context.getLocation(node);\n return new TypeQuerySchema(location, type, displaySig);\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA;AACA;AACA;AACO,MAAMI,oBAAoB,CAA8B;EAC7DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,SAAS;EAC9C;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAAmB,EAAEO,OAA+B,EAAE;IACpE,MAAMC,UAAU,GAAG,MAAMD,OAAO,CAACE,yBAAyB,CAACT,IAAI,CAACU,QAAQ,CAAC;IACzE,MAAMC,IAAI,GAAG,MAAMJ,OAAO,CAACK,WAAW,CAACZ,IAAI,CAACU,QAAQ,EAAEV,IAAI,CAACU,QAAQ,CAACG,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC;IACrF,MAAMC,QAAQ,GAAGP,OAAO,CAACQ,WAAW,CAACf,IAAI,CAAC;IAC1C,OAAO,KAAIgB,oCAAe,EAACF,QAAQ,EAAEH,IAAI,EAAEH,UAAU,CAAC;EACxD;AACF;AAACS,OAAA,CAAAnB,oBAAA,GAAAA,oBAAA"}
|