@formatjs/intl
Advanced tools
Comparing version 1.18.5 to 2.0.0
import { IntlCache, CustomFormats, Formatters, OnErrorFn, ResolvedIntlConfig } from './types'; | ||
import { NumberFormatOptions } from '@formatjs/ecma402-abstract'; | ||
export declare function filterProps<T extends Record<string, any>, K extends string>(props: T, whitelist: Array<K>, defaults?: Partial<T>): Pick<T, K>; | ||
export declare function filterProps<T extends Record<string, any>, K extends string>(props: T, allowlist: Array<K>, defaults?: Partial<T>): Pick<T, K>; | ||
export declare const DEFAULT_INTL_CONFIG: Pick<ResolvedIntlConfig<any>, 'fallbackOnEmptyString' | 'formats' | 'messages' | 'timeZone' | 'defaultLocale' | 'defaultFormats' | 'onError'>; | ||
@@ -5,0 +5,0 @@ export declare function createIntlCache(): IntlCache; |
@@ -5,5 +5,5 @@ import { __assign, __spreadArray } from "tslib"; | ||
import { UnsupportedFormatterError } from './error'; | ||
export function filterProps(props, whitelist, defaults) { | ||
export function filterProps(props, allowlist, defaults) { | ||
if (defaults === void 0) { defaults = {}; } | ||
return whitelist.reduce(function (filtered, name) { | ||
return allowlist.reduce(function (filtered, name) { | ||
if (name in props) { | ||
@@ -10,0 +10,0 @@ filtered[name] = props[name]; |
{ | ||
"name": "@formatjs/intl", | ||
"version": "1.18.5", | ||
"version": "2.0.0", | ||
"description": "Internationalize JS apps. This library provides an API to format dates, numbers, and strings, including pluralization and handling translations.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
import { IntlCache, CustomFormats, Formatters, OnErrorFn, ResolvedIntlConfig } from './types'; | ||
import { NumberFormatOptions } from '@formatjs/ecma402-abstract'; | ||
export declare function filterProps<T extends Record<string, any>, K extends string>(props: T, whitelist: Array<K>, defaults?: Partial<T>): Pick<T, K>; | ||
export declare function filterProps<T extends Record<string, any>, K extends string>(props: T, allowlist: Array<K>, defaults?: Partial<T>): Pick<T, K>; | ||
export declare const DEFAULT_INTL_CONFIG: Pick<ResolvedIntlConfig<any>, 'fallbackOnEmptyString' | 'formats' | 'messages' | 'timeZone' | 'defaultLocale' | 'defaultFormats' | 'onError'>; | ||
@@ -5,0 +5,0 @@ export declare function createIntlCache(): IntlCache; |
@@ -8,5 +8,5 @@ "use strict"; | ||
var error_1 = require("./error"); | ||
function filterProps(props, whitelist, defaults) { | ||
function filterProps(props, allowlist, defaults) { | ||
if (defaults === void 0) { defaults = {}; } | ||
return whitelist.reduce(function (filtered, name) { | ||
return allowlist.reduce(function (filtered, name) { | ||
if (name in props) { | ||
@@ -13,0 +13,0 @@ filtered[name] = props[name]; |
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
134909