INNER CODE UNIT · TypeScript

unhandled

dotnet-websharper/core · src/compiler/WebSharper.TypeScriptParser/app.ts:195

function unhandled(x: ts.Node, ctx: string) {
  throw Error(`Unhandled SyntaxKind for ${ctx}: ${x.kind} '${x.getText()}' in ${x.getSourceFile().fileName}`);
}

function transformType(x: ts.TypeNode): TSType {
  if (!x) return simpleType('any');
  if (ts.isParenthesizedTypeNode(x))
    return transformType(x.type)
  if (ts.isArrayTypeNode(x))
    return {
      Kind: 'array',
      ElementType: transformType(x.elementType)
    }
  if (ts.isTupleTypeNode(x))
    return {
      Kind: 'tuple',
      ElementTypes: x.elements.map(transformType)
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…