MCPcopy Create free account
hub / github.com/adobe/react-spectrum / handler

Function handler

packages/dev/optimize-locales-plugin/LocalesPlugin.js:43–57  ·  view source on GitHub ↗
(specifier, sourcePath, options)

Source from the content-addressed store, hash-verified

41 id: localeSpecifierRegex
42 },
43 handler(specifier, sourcePath, options) {
44 if (!sourcePathRegex.test(sourcePath) || options?.ssr) {
45 return;
46 }
47
48 let match = specifier.match(localeSpecifierRegex);
49 if (match) {
50 let locale = new Intl.Locale(match[0]);
51 if (!locales.some(l => localeMatches(locale, l))) {
52 return path.join(__dirname, 'empty.js');
53 }
54 }
55
56 return null;
57 }
58 }
59 };
60});

Callers

nothing calls this directly

Calls 1

localeMatchesFunction · 0.70

Tested by

no test coverage detected