MCPcopy Create free account
hub / github.com/cure53/DOMPurify / fixEsmTypes

Function fixEsmTypes

scripts/fix-types.js:52–59  ·  view source on GitHub ↗

* Fixes the ES module type declarations file. * @param {string} fileName

(fileName)

Source from the content-addressed store, hash-verified

50 * @param {string} fileName
51 */
52async function fixEsmTypes(fileName) {
53 try {
54 const types = await fs.readFile(fileName, { encoding: 'utf-8' });
55 await fs.writeFile(fileName, rewriteInlineTypeExports(types));
56 } catch (err) {
57 console.warn(`Warning: Could not patch ${fileName}. Error: ${err.message}`);
58 }
59}
60
61/**
62 * Fixes the CommonJS type declarations file.

Callers 1

fix-types.jsFile · 0.85

Calls 1

rewriteInlineTypeExportsFunction · 0.85

Tested by

no test coverage detected