svelte-i18n
Advanced tools
Comparing version 3.7.2 to 3.7.3-0
@@ -5,3 +5,2 @@ 'use strict'; | ||
var deepmerge = require('deepmerge'); | ||
var intlGetcanonicallocales = require('@formatjs/intl-getcanonicallocales'); | ||
var IntlMessageFormat = require('intl-messageformat'); | ||
@@ -247,7 +246,9 @@ | ||
try { | ||
const canonicalizedLocale = intlGetcanonicallocales.getCanonicalLocales(opts.initialLocale); | ||
if (canonicalizedLocale.length >= 1) { | ||
initialLocale = canonicalizedLocale[0]; | ||
if (IntlMessageFormat.resolveLocale(opts.initialLocale)) { | ||
initialLocale = opts.initialLocale; | ||
} | ||
} catch (e) { | ||
console.warn( | ||
`[svelte-i18n] The initial locale "${opts.initialLocale}" is not a valid locale.` | ||
); | ||
} | ||
@@ -254,0 +255,0 @@ } |
import { writable, derived } from 'svelte/store'; | ||
import deepmerge from 'deepmerge'; | ||
import { getCanonicalLocales } from '@formatjs/intl-getcanonicallocales'; | ||
import IntlMessageFormat from 'intl-messageformat'; | ||
@@ -244,7 +243,9 @@ | ||
try { | ||
const canonicalizedLocale = getCanonicalLocales(opts.initialLocale); | ||
if (canonicalizedLocale.length >= 1) { | ||
initialLocale = canonicalizedLocale[0]; | ||
if (IntlMessageFormat.resolveLocale(opts.initialLocale)) { | ||
initialLocale = opts.initialLocale; | ||
} | ||
} catch (e) { | ||
console.warn( | ||
`[svelte-i18n] The initial locale "${opts.initialLocale}" is not a valid locale.` | ||
); | ||
} | ||
@@ -251,0 +252,0 @@ } |
{ | ||
"name": "svelte-i18n", | ||
"version": "3.7.2", | ||
"version": "3.7.3-0", | ||
"main": "dist/runtime.cjs.js", | ||
@@ -27,2 +27,15 @@ "module": "dist/runtime.esm.js", | ||
}, | ||
"scripts": { | ||
"clean": "rm -rf dist/", | ||
"build": "rollup -c", | ||
"dev": "rollup -c -w", | ||
"test": "cross-env NODE_ICU_DATA=node_modules/full-icu jest", | ||
"test:ci": "pnpm test -- --silent", | ||
"lint": "eslint \"{src,test}/**/*.ts\"", | ||
"format": "prettier --loglevel silent --write \"{src,test}/**/*.ts\"", | ||
"release": " git add package.json && git commit -m \"chore(release): v$npm_package_version :tada:\"", | ||
"prebuild": "pnpm clean", | ||
"version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1 && git add CHANGELOG.md", | ||
"prepublishOnly": "pnpm test -- --no-cache && pnpm build" | ||
}, | ||
"files": [ | ||
@@ -79,3 +92,2 @@ "dist/" | ||
"dependencies": { | ||
"@formatjs/intl-getcanonicallocales": "^2.2.1", | ||
"cli-color": "^2.0.3", | ||
@@ -88,15 +100,3 @@ "deepmerge": "^4.2.2", | ||
"tiny-glob": "^0.2.9" | ||
}, | ||
"scripts": { | ||
"clean": "rm -rf dist/", | ||
"build": "rollup -c", | ||
"dev": "rollup -c -w", | ||
"test": "cross-env NODE_ICU_DATA=node_modules/full-icu jest", | ||
"test:ci": "pnpm test -- --silent", | ||
"lint": "eslint \"{src,test}/**/*.ts\"", | ||
"format": "prettier --loglevel silent --write \"{src,test}/**/*.ts\"", | ||
"release": " git add package.json && git commit -m \"chore(release): v$npm_package_version :tada:\"", | ||
"prebuild": "pnpm clean", | ||
"version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1 && git add CHANGELOG.md" | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
8
1548
0
57677
2
- Removed@formatjs/intl-getcanonicallocales@2.3.0(transitive)