MCPcopy Create free account
hub / github.com/opral/inlang / assertLegacyStringPathPattern

Function assertLegacyStringPathPattern

packages/plugins/next-intl/src/plugin.ts:342–351  ·  view source on GitHub ↗
(
	pathPattern: PluginSettings["pathPattern"]
)

Source from the content-addressed store, hash-verified

340}
341
342function assertLegacyStringPathPattern(
343 pathPattern: PluginSettings["pathPattern"]
344): string {
345 if (typeof pathPattern !== "string") {
346 throw new Error(
347 "Namespace pathPattern objects require the new import/export API."
348 );
349 }
350 return pathPattern;
351}
352
353function replaceLocale(pathPattern: string, locale: string): string {
354 return pathPattern.replace(/\{(languageTag|locale)\}/g, locale);

Callers 2

loadMessagesFunction · 0.85
saveMessagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected