@formatjs/intl 1.18.2 → 2.0.0

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.
@@ -1,6 +1,6 @@
1
1
  import { IntlCache, CustomFormats, Formatters, OnErrorFn, ResolvedIntlConfig } from './types';
2
2
  import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
3
- export declare function filterProps<T extends Record<string, any>, K extends string>(props: T, whitelist: Array<K>, defaults?: Partial<T>): Pick<T, K>;
3
+ export declare function filterProps<T extends Record<string, any>, K extends string>(props: T, allowlist: Array<K>, defaults?: Partial<T>): Pick<T, K>;
4
4
  export declare const DEFAULT_INTL_CONFIG: Pick<ResolvedIntlConfig<any>, 'fallbackOnEmptyString' | 'formats' | 'messages' | 'timeZone' | 'defaultLocale' | 'defaultFormats' | 'onError'>;
5
5
  export declare function createIntlCache(): IntlCache;
6
6
  /**
package/lib/src/utils.js CHANGED
@@ -2,9 +2,9 @@ import { __assign, __spreadArray } from "tslib";
2
2
  import { IntlMessageFormat } from 'intl-messageformat';
3
3
  import memoize, { strategies } from '@formatjs/fast-memoize';
4
4
  import { UnsupportedFormatterError } from './error';
5
- export function filterProps(props, whitelist, defaults) {
5
+ export function filterProps(props, allowlist, defaults) {
6
6
  if (defaults === void 0) { defaults = {}; }
7
- return whitelist.reduce(function (filtered, name) {
7
+ return allowlist.reduce(function (filtered, name) {
8
8
  if (name in props) {
9
9
  filtered[name] = props[name];
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formatjs/intl",
3
- "version": "1.18.2",
3
+ "version": "2.0.0",
4
4
  "description": "Internationalize JS apps. This library provides an API to format dates, numbers, and strings, including pluralization and handling translations.",
5
5
  "keywords": [
6
6
  "intl",
@@ -29,12 +29,12 @@
29
29
  "module": "lib/index.js",
30
30
  "sideEffects": false,
31
31
  "dependencies": {
32
- "@formatjs/ecma402-abstract": "1.11.1",
32
+ "@formatjs/ecma402-abstract": "1.11.3",
33
33
  "@formatjs/fast-memoize": "1.2.1",
34
- "@formatjs/icu-messageformat-parser": "2.0.16",
35
- "@formatjs/intl-displaynames": "5.4.0",
36
- "@formatjs/intl-listformat": "6.5.0",
37
- "intl-messageformat": "9.11.1",
34
+ "@formatjs/icu-messageformat-parser": "2.0.18",
35
+ "@formatjs/intl-displaynames": "5.4.2",
36
+ "@formatjs/intl-listformat": "6.5.2",
37
+ "intl-messageformat": "9.11.4",
38
38
  "tslib": "^2.1.0"
39
39
  },
40
40
  "peerDependencies": {
package/src/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { IntlCache, CustomFormats, Formatters, OnErrorFn, ResolvedIntlConfig } from './types';
2
2
  import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
3
- export declare function filterProps<T extends Record<string, any>, K extends string>(props: T, whitelist: Array<K>, defaults?: Partial<T>): Pick<T, K>;
3
+ export declare function filterProps<T extends Record<string, any>, K extends string>(props: T, allowlist: Array<K>, defaults?: Partial<T>): Pick<T, K>;
4
4
  export declare const DEFAULT_INTL_CONFIG: Pick<ResolvedIntlConfig<any>, 'fallbackOnEmptyString' | 'formats' | 'messages' | 'timeZone' | 'defaultLocale' | 'defaultFormats' | 'onError'>;
5
5
  export declare function createIntlCache(): IntlCache;
6
6
  /**
package/src/utils.js CHANGED
@@ -5,9 +5,9 @@ var tslib_1 = require("tslib");
5
5
  var intl_messageformat_1 = require("intl-messageformat");
6
6
  var fast_memoize_1 = (0, tslib_1.__importStar)(require("@formatjs/fast-memoize"));
7
7
  var error_1 = require("./error");
8
- function filterProps(props, whitelist, defaults) {
8
+ function filterProps(props, allowlist, defaults) {
9
9
  if (defaults === void 0) { defaults = {}; }
10
- return whitelist.reduce(function (filtered, name) {
10
+ return allowlist.reduce(function (filtered, name) {
11
11
  if (name in props) {
12
12
  filtered[name] = props[name];
13
13
  }