MCPcopy Create free account
hub / github.com/Silentely/eSIM-Tools / extractLibraryCode

Function extractLibraryCode

scripts/sync-qrcode-lib.js:19–33  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

17const EDGE_LIB = path.resolve(__dirname, '../netlify/edge-functions/qrcode-lib.js');
18
19function extractLibraryCode(filePath) {
20 const content = fs.readFileSync(filePath, 'utf-8').replace(/\r\n/g, '\n');
21 // 提取 'use strict'; 和 export 之间的库代码
22 const lines = content.split('\n');
23 const libLines = lines.filter(line =>
24 line !== "'use strict';" &&
25 !line.startsWith('// ') &&
26 !line.startsWith('/**') &&
27 !line.startsWith(' * ') &&
28 !line.startsWith(' */') &&
29 line !== '' &&
30 !line.startsWith('export ')
31 );
32 return libLines.join('\n');
33}
34
35const browserLib = extractLibraryCode(BROWSER_LIB);
36const edgeLib = extractLibraryCode(EDGE_LIB);

Callers 1

sync-qrcode-lib.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected