MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / processDefinitionFile

Function processDefinitionFile

tools/scripts/generate-tns-compat.ts:53–70  ·  view source on GitHub ↗
(entry: EntryInfo)

Source from the content-addressed store, hash-verified

51}
52
53function processDefinitionFile(entry: EntryInfo) {
54 if (dtsBlacklist.includes(entry.path)) {
55 return;
56 }
57
58 const relativeFilePathNoExt = entry.path.replace(/\.d\.ts$/, '');
59
60 // Re-export everything from d.ts file
61 createReExportFile(relativeFilePathNoExt, '.d.ts');
62
63 // This might be only a definitions file.
64 // So check if there is ts/js files before creating TS file with re-exports
65 const baseFile = path.join(inputFolder, relativeFilePathNoExt);
66 if (fs.existsSync(baseFile + '.ts') || fs.existsSync(baseFile + '.js') || (fs.existsSync(baseFile + '.android.ts') && fs.existsSync(baseFile + '.ios.ts')) || (fs.existsSync(baseFile + '.android.js') && fs.existsSync(baseFile + '.ios.js'))) {
67 createReExportFile(relativeFilePathNoExt, '.ts');
68 addTestImport(relativeFilePathNoExt);
69 }
70}
71
72function processTypeScriptFile(entry: EntryInfo) {
73 const relativeFilePathNoExt = entry.path.replace(/\.ts$/, '');

Callers

nothing calls this directly

Calls 5

createReExportFileFunction · 0.85
addTestImportFunction · 0.85
includesMethod · 0.80
replaceMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected