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

Function onChange

tasks/bundle-locales.js:102–111  ·  view source on GitHub ↗
(changedFiles, _, platforms)

Source from the content-addressed store, hash-verified

100export function createBundleLocalesTask(srcLocalesDir) {
101 /** @type {(changedFiles: string[], watcher: any, platforms: any) => Promise<void>} */
102 const onChange = async (changedFiles, _, platforms) => {
103 const localesSrcDir = absolutePath(srcLocalesDir);
104 for (const file of changedFiles) {
105 const fileName = file.substring(file.lastIndexOf(path.sep) + 1);
106 const code = /** @type {string} */(fileName.split('.').at(-2));
107 const locale = await mergeLocale(localesSrcDir, code);
108 await writeFiles(locale, fileName, {platforms, debug: true});
109 }
110 reload.reload({type: reload.FULL});
111 };
112
113 return createTask(
114 'bundle-locales',

Callers

nothing calls this directly

Calls 3

absolutePathFunction · 0.90
mergeLocaleFunction · 0.85
writeFilesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…