Skip to content

Commit d350f35

Browse files
committedJan 10, 2025·
fix(@angular/build): correctly validate locales subPath
The `subPath` validation function was not being called. (cherry picked from commit 81a83df)
1 parent 955acef commit d350f35

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎packages/angular/build/src/utils/i18n-options.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function ensureString(value: unknown, name: string): asserts value is string {
6565
}
6666
}
6767

68-
function ensureValidsubPath(value: unknown, name: string): asserts value is string {
68+
function ensureValidSubPath(value: unknown, name: string): asserts value is string {
6969
ensureString(value, name);
7070

7171
if (!/^[\w-]*$/.test(value)) {
@@ -121,7 +121,7 @@ export function createI18nOptions(
121121
}
122122

123123
if (metadata.sourceLocale.subPath !== undefined) {
124-
ensureValidsubPath(metadata.sourceLocale.subPath, 'i18n.sourceLocale.subPath');
124+
ensureValidSubPath(metadata.sourceLocale.subPath, 'i18n.sourceLocale.subPath');
125125
rawsubPath = metadata.sourceLocale.subPath;
126126
}
127127

@@ -166,7 +166,7 @@ export function createI18nOptions(
166166
}
167167

168168
if ('subPath' in options) {
169-
ensureString(options.subPath, `i18n.locales.${locale}.subPath`);
169+
ensureValidSubPath(options.subPath, `i18n.locales.${locale}.subPath`);
170170
subPath = options.subPath;
171171
}
172172

0 commit comments

Comments
 (0)
Please sign in to comment.