Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@formatjs/intl

Package Overview
Dependencies
Maintainers
3
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formatjs/intl - npm Package Compare versions

Comparing version 1.18.5 to 2.0.0

2

lib/src/utils.d.ts
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];

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc