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

Function forEachImportInStatement

test/fixtures/snapshot/typescript.js:162222–162240  ·  view source on GitHub ↗
(statement, cb)

Source from the content-addressed store, hash-verified

162220 : i.initializer.arguments[0]);
162221 }
162222 function forEachImportInStatement(statement, cb) {
162223 if (ts.isImportDeclaration(statement)) {
162224 if (ts.isStringLiteral(statement.moduleSpecifier))
162225 cb(statement);
162226 }
162227 else if (ts.isImportEqualsDeclaration(statement)) {
162228 if (ts.isExternalModuleReference(statement.moduleReference) && ts.isStringLiteralLike(statement.moduleReference.expression)) {
162229 cb(statement);
162230 }
162231 }
162232 else if (ts.isVariableStatement(statement)) {
162233 for (var _i = 0, _a = statement.declarationList.declarations; _i < _a.length; _i++) {
162234 var decl = _a[_i];
162235 if (decl.initializer && ts.isRequireCall(decl.initializer, /*checkArgumentIsStringLiteralLike*/ true)) {
162236 cb(decl);
162237 }
162238 }
162239 }
162240 }
162241 function createOldFileImportsFromNewFile(newFileNeedExport, newFileNameWithExtension, useEs6Imports, quotePreference) {
162242 var defaultImport;
162243 var imports = [];

Callers 3

deleteUnusedOldImportsFunction · 0.85
_loop_20Function · 0.85

Calls 1

cbFunction · 0.50

Tested by

no test coverage detected