MCPcopy Index your code
hub / github.com/nodejs/node / getTypeDeepCloneUnionUndefined

Function getTypeDeepCloneUnionUndefined

test/fixtures/snapshot/typescript.js:160907–160919  ·  view source on GitHub ↗
(typeNode)

Source from the content-addressed store, hash-verified

160905 var renameLocation = ts.getRenameLocation(edits, renameFilename, functionNameText, /*isDeclaredBeforeUse*/ false);
160906 return { renameFilename: renameFilename, renameLocation: renameLocation, edits: edits };
160907 function getTypeDeepCloneUnionUndefined(typeNode) {
160908 if (typeNode === undefined) {
160909 return undefined;
160910 }
160911 var clone = ts.getSynthesizedDeepClone(typeNode);
160912 var withoutParens = clone;
160913 while (ts.isParenthesizedTypeNode(withoutParens)) {
160914 withoutParens = withoutParens.type;
160915 }
160916 return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 153 /* SyntaxKind.UndefinedKeyword */; })
160917 ? clone
160918 : ts.factory.createUnionTypeNode([clone, ts.factory.createKeywordTypeNode(153 /* SyntaxKind.UndefinedKeyword */)]);
160919 }
160920 }
160921 /**
160922 * Result of 'extractRange' operation for a specific scope.

Callers 1

extractFunctionInScopeFunction · 0.85

Calls 1

findMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…