@formatjs/intl-utils
Advanced tools
Comparing version 2.3.0 to 3.0.0
@@ -6,2 +6,19 @@ # Change Log | ||
# [3.0.0](https://github.com/formatjs/formatjs/compare/@formatjs/intl-utils@2.3.0...@formatjs/intl-utils@3.0.0) (2020-05-23) | ||
### Features | ||
* **@formatjs/intl-utils:** Use native Intl.getCanonicalLocales ([b6ff8fb](https://github.com/formatjs/formatjs/commit/b6ff8fba63c33601752c4d2cfde504b30d617cd9)) | ||
### BREAKING CHANGES | ||
* **@formatjs/intl-utils:** This requires @formatjs/intl-getcanonicallocales for | ||
IE11 and below | ||
# [2.3.0](https://github.com/formatjs/formatjs/compare/@formatjs/intl-utils@2.2.5...@formatjs/intl-utils@2.3.0) (2020-05-16) | ||
@@ -8,0 +25,0 @@ |
@@ -11,4 +11,3 @@ export { selectUnit } from './diff'; | ||
export * from './displaynames-types'; | ||
export { getCanonicalLocales } from './get-canonical-locales'; | ||
export { invariant } from './invariant'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -33,6 +33,4 @@ "use strict"; | ||
__export(require("./number-types")); | ||
var get_canonical_locales_1 = require("./get-canonical-locales"); | ||
exports.getCanonicalLocales = get_canonical_locales_1.getCanonicalLocales; | ||
var invariant_1 = require("./invariant"); | ||
exports.invariant = invariant_1.invariant; | ||
//# sourceMappingURL=index.js.map |
@@ -27,3 +27,2 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var get_canonical_locales_1 = require("./get-canonical-locales"); | ||
var invariant_1 = require("./invariant"); | ||
@@ -98,3 +97,3 @@ var polyfill_utils_1 = require("./polyfill-utils"); | ||
} | ||
foundLocale = get_canonical_locales_1.getCanonicalLocales(foundLocale)[0]; | ||
foundLocale = Intl.getCanonicalLocales(foundLocale)[0]; | ||
} | ||
@@ -101,0 +100,0 @@ result.locale = foundLocale; |
@@ -11,4 +11,3 @@ export { selectUnit } from './diff'; | ||
export * from './displaynames-types'; | ||
export { getCanonicalLocales } from './get-canonical-locales'; | ||
export { invariant } from './invariant'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,4 +6,3 @@ export { selectUnit } from './diff'; | ||
export * from './number-types'; | ||
export { getCanonicalLocales } from './get-canonical-locales'; | ||
export { invariant } from './invariant'; | ||
//# sourceMappingURL=index.js.map |
@@ -110,8 +110,2 @@ | ||
/** | ||
* IE11-safe version of getCanonicalLocales since it's ES2016 | ||
* @param locales locales | ||
*/ | ||
export declare function getCanonicalLocales(locales?: string | string[]): string[]; | ||
export declare function getInternalSlot<Instance extends object, Internal extends object, Field extends keyof Internal>(map: WeakMap<Instance, Internal>, pl: Instance, field: Field): Internal[Field]; | ||
@@ -118,0 +112,0 @@ |
@@ -25,3 +25,2 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
import { getCanonicalLocales } from './get-canonical-locales'; | ||
import { invariant } from './invariant'; | ||
@@ -96,3 +95,3 @@ import { toObject, getOption } from './polyfill-utils'; | ||
} | ||
foundLocale = getCanonicalLocales(foundLocale)[0]; | ||
foundLocale = Intl.getCanonicalLocales(foundLocale)[0]; | ||
} | ||
@@ -99,0 +98,0 @@ result.locale = foundLocale; |
{ | ||
"name": "@formatjs/intl-utils", | ||
"version": "2.3.0", | ||
"version": "3.0.0", | ||
"description": "Smartly determine best unit for relative time format", | ||
@@ -39,3 +39,3 @@ "keywords": [ | ||
"license": "MIT", | ||
"gitHead": "5b218606c3ec03e332f472706fffd04153c20dae", | ||
"gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c", | ||
"devDependencies": { | ||
@@ -42,0 +42,0 @@ "@types/chai": "^4.2.11", |
@@ -35,3 +35,2 @@ export {selectUnit} from './diff'; | ||
export * from './displaynames-types'; | ||
export {getCanonicalLocales} from './get-canonical-locales'; | ||
export {invariant} from './invariant'; |
@@ -1,2 +0,1 @@ | ||
import {getCanonicalLocales} from './get-canonical-locales'; | ||
import {invariant} from './invariant'; | ||
@@ -99,3 +98,3 @@ import {toObject, getOption} from './polyfill-utils'; | ||
} | ||
foundLocale = getCanonicalLocales(foundLocale)[0]; | ||
foundLocale = (Intl as any).getCanonicalLocales(foundLocale)[0]; | ||
} | ||
@@ -102,0 +101,0 @@ result.locale = foundLocale; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
299593
141
5089