MCPcopy Index your code
hub / github.com/darkreader/darkreader / writeFiles

Function writeFiles

tasks/bundle-locales.js:86–94  ·  view source on GitHub ↗
(data, fileName, {platforms, debug})

Source from the content-addressed store, hash-verified

84}
85
86async function writeFiles(data, fileName, {platforms, debug}){
87 const locale = fileName.substring(0, fileName.lastIndexOf('.')).replace('-', '_');
88 const getOutputPath = (dir) => `${dir}/_locales/${locale}/messages.json`;
89 const enabledPlatforms = Object.values(PLATFORM).filter((platform) => platform !== PLATFORM.API && platforms[platform]);
90 for (const platform of enabledPlatforms) {
91 const dir = getDestDir({debug, platform});
92 await writeFile(getOutputPath(dir), data);
93 }
94}
95
96/**
97 * @param {string} srcLocalesDir

Callers 2

bundleLocalesFunction · 0.70
onChangeFunction · 0.70

Calls 3

getDestDirFunction · 0.90
writeFileFunction · 0.90
getOutputPathFunction · 0.85

Tested by

no test coverage detected