MCPcopy Create free account
hub / github.com/meliorence/react-native-render-html / optimizeSvgFile

Function optimizeSvgFile

scripts/processSvgAssets.js:26–39  ·  view source on GitHub ↗
(assetName)

Source from the content-addressed store, hash-verified

24]);
25
26async function optimizeSvgFile(assetName) {
27 const sourceFile = path.join(sourceDir, assetName);
28 const svg = await fs.readFile(sourceFile);
29 const resultPass1 = optimize(svg, {
30 multipass: true,
31 plugins: configPluginsFirstPass
32 });
33 if (resultPass1.error) {
34 throw new Error(resultPass1.error);
35 }
36
37 await fs.writeFile(path.join(targetDemoDir, assetName), resultPass1.data);
38 await fs.writeFile(path.join(targetWebsiteDir, assetName), resultPass1.data);
39}
40
41async function run() {
42 const assets = await fs.readdir(sourceDir);

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…