mayak-common-library 0.0.721 → 0.0.722

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/i18n/request.ts +6 -0
  2. package/package.json +1 -1
package/i18n/request.ts CHANGED
@@ -1,7 +1,13 @@
1
1
  import { getRequestConfig } from 'next-intl/server'
2
+ import { routing } from './routing'
2
3
 
3
4
  export default getRequestConfig(async ({ requestLocale }) => {
4
5
  let locale = (await requestLocale) || 'en'
6
+
7
+ // Ensure that the incoming locale is valid
8
+ if (!locale || !routing.locales.includes(locale as any))
9
+ locale = routing.defaultLocale
10
+
5
11
  return {
6
12
  messages: (await import(`../messages/${locale}.json`)).default,
7
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mayak-common-library",
3
- "version": "0.0.721",
3
+ "version": "0.0.722",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",