@appsemble/utils 0.36.6 → 0.36.7

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.
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
- # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.36.6/config/assets/logo.svg) Appsemble Utilities
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.36.7/config/assets/logo.svg) Appsemble Utilities
2
2
 
3
3
  > Internal utility functions used across multiple Appsemble projects.
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@appsemble/utils)](https://www.npmjs.com/package/@appsemble/utils)
6
- [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.36.6/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.36.6)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.36.7/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.36.7)
7
7
  [![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io)
8
8
 
9
9
  ## Table of Contents
@@ -26,5 +26,5 @@ not guaranteed.
26
26
 
27
27
  ## License
28
28
 
29
- [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.36.6/LICENSE.md) ©
29
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.36.7/LICENSE.md) ©
30
30
  [Appsemble](https://appsemble.com)
package/i18n.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export declare function normalizeLocale(language: string): string;
1
2
  /**
2
3
  * Sort locales by specificity
3
4
  *
package/i18n.js CHANGED
@@ -1,3 +1,6 @@
1
+ export function normalizeLocale(language) {
2
+ return language.replaceAll('_', '-').toLowerCase();
3
+ }
1
4
  /**
2
5
  * Sort locales by specificity
3
6
  *
@@ -12,7 +15,7 @@
12
15
  * @returns A sorted list of lower case languages in order of preference.
13
16
  */
14
17
  export function sortLocales(languages) {
15
- const copy = languages.map((language) => language.toLowerCase());
18
+ const copy = languages.map(normalizeLocale);
16
19
  // Compare every language to the previous in the array. The first item is skipped, since there is
17
20
  // nothing to compare against.
18
21
  for (let i = 1; i < copy.length; i += 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsemble/utils",
3
- "version": "0.36.6",
3
+ "version": "0.36.7",
4
4
  "description": "Utility functions used in Appsemble internally",
5
5
  "keywords": [
6
6
  "app",
@@ -39,8 +39,8 @@
39
39
  "test": "vitest"
40
40
  },
41
41
  "dependencies": {
42
- "@appsemble/lang-sdk": "0.36.6",
43
- "@appsemble/types": "0.36.6",
42
+ "@appsemble/lang-sdk": "0.36.7",
43
+ "@appsemble/types": "0.36.7",
44
44
  "@fortawesome/fontawesome-common-types": "^6.0.0",
45
45
  "axios": "^1.0.0",
46
46
  "langmap": "^0.0.16",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/langmap": "0.0.3",
53
- "bulma": "=0.9.3",
53
+ "bulma": "=0.9.4",
54
54
  "koas-core": "0.7.0",
55
55
  "vitest": "2.1.9"
56
56
  },
package/theme.js CHANGED
@@ -26,6 +26,6 @@ export function createThemeURL(theme) {
26
26
  });
27
27
  // Sort for cacheability.
28
28
  params.sort();
29
- return `/bulma/0.9.3/bulma.min.css?${params}`;
29
+ return `/bulma/0.9.4/bulma.min.css?${params}`;
30
30
  }
31
31
  //# sourceMappingURL=theme.js.map