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

Function containsOnlyAmbientModules

test/fixtures/snapshot/typescript.js:119966–119974  ·  view source on GitHub ↗

* For script files that contains only ambient external modules, although they are not actually external module files, * they can only be consumed via importing elements from them. Regular script files cannot consume them. Therefore, * there are no point to rebuild all script files

(sourceFile)

Source from the content-addressed store, hash-verified

119964 * in the file is not ambient external module, we treat it as a regular script file.
119965 */
119966 function containsOnlyAmbientModules(sourceFile) {
119967 for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
119968 var statement = _a[_i];
119969 if (!ts.isModuleWithStringLiteralName(statement)) {
119970 return false;
119971 }
119972 }
119973 return true;
119974 }
119975 /**
119976 * Return true if file contains anything that augments to global scope we need to build them as if
119977 * they are global files as well as module

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected