MCPcopy Create free account
hub / github.com/nodejs/node / addImportType

Function addImportType

test/fixtures/snapshot/typescript.js:153860–153863  ·  view source on GitHub ↗
(changes, sourceFile, _a, quotePreference)

Source from the content-addressed store, hash-verified

153858 changes.insertText(sourceFile, position, namespacePrefix + ".");
153859 }
153860 function addImportType(changes, sourceFile, _a, quotePreference) {
153861 var moduleSpecifier = _a.moduleSpecifier, position = _a.position;
153862 changes.insertText(sourceFile, position, getImportTypePrefix(moduleSpecifier, quotePreference));
153863 }
153864 function getImportTypePrefix(moduleSpecifier, quotePreference) {
153865 var quote = ts.getQuoteFromPreference(quotePreference);
153866 return "import(".concat(quote).concat(moduleSpecifier).concat(quote, ").");

Callers 2

writeFixesFunction · 0.85
codeActionForFixWorkerFunction · 0.85

Calls 1

getImportTypePrefixFunction · 0.85

Tested by

no test coverage detected