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
160
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.10.0 to 1.10.1

33

lib/src/utils.js
import { __assign, __spreadArray } from "tslib";
import { IntlMessageFormat } from 'intl-messageformat';
import * as memoize from 'fast-memoize';
import memoize, { strategies } from '@formatjs/fast-memoize';
import { UnsupportedFormatterError } from './error';

@@ -58,5 +58,2 @@ export function filterProps(props, whitelist, defaults) {

}
// @ts-ignore this is to deal with rollup's default import shenanigans
var _memoizeIntl = memoize.default || memoize;
var memoizeIntl = _memoizeIntl;
/**

@@ -71,3 +68,3 @@ * Create intl formatters and populate cache

var DisplayNames = Intl.DisplayNames;
var getDateTimeFormat = memoizeIntl(function () {
var getDateTimeFormat = memoize(function () {
var _a;

@@ -81,5 +78,5 @@ var args = [];

cache: createFastMemoizeCache(cache.dateTime),
strategy: memoizeIntl.strategies.variadic,
strategy: strategies.variadic,
});
var getNumberFormat = memoizeIntl(function () {
var getNumberFormat = memoize(function () {
var _a;

@@ -93,5 +90,5 @@ var args = [];

cache: createFastMemoizeCache(cache.number),
strategy: memoizeIntl.strategies.variadic,
strategy: strategies.variadic,
});
var getPluralRules = memoizeIntl(function () {
var getPluralRules = memoize(function () {
var _a;

@@ -105,3 +102,3 @@ var args = [];

cache: createFastMemoizeCache(cache.pluralRules),
strategy: memoizeIntl.strategies.variadic,
strategy: strategies.variadic,
});

@@ -111,3 +108,3 @@ return {

getNumberFormat: getNumberFormat,
getMessageFormat: memoizeIntl(function (message, locales, overrideFormats, opts) {
getMessageFormat: memoize(function (message, locales, overrideFormats, opts) {
return new IntlMessageFormat(message, locales, overrideFormats, __assign({ formatters: {

@@ -120,5 +117,5 @@ getNumberFormat: getNumberFormat,

cache: createFastMemoizeCache(cache.message),
strategy: memoizeIntl.strategies.variadic,
strategy: strategies.variadic,
}),
getRelativeTimeFormat: memoizeIntl(function () {
getRelativeTimeFormat: memoize(function () {
var args = [];

@@ -131,6 +128,6 @@ for (var _i = 0; _i < arguments.length; _i++) {

cache: createFastMemoizeCache(cache.relativeTime),
strategy: memoizeIntl.strategies.variadic,
strategy: strategies.variadic,
}),
getPluralRules: getPluralRules,
getListFormat: memoizeIntl(function () {
getListFormat: memoize(function () {
var args = [];

@@ -143,5 +140,5 @@ for (var _i = 0; _i < arguments.length; _i++) {

cache: createFastMemoizeCache(cache.list),
strategy: memoizeIntl.strategies.variadic,
strategy: strategies.variadic,
}),
getDisplayNames: memoizeIntl(function () {
getDisplayNames: memoize(function () {
var args = [];

@@ -154,3 +151,3 @@ for (var _i = 0; _i < arguments.length; _i++) {

cache: createFastMemoizeCache(cache.displayNames),
strategy: memoizeIntl.strategies.variadic,
strategy: strategies.variadic,
}),

@@ -157,0 +154,0 @@ };

{
"name": "@formatjs/intl",
"version": "1.10.0",
"version": "1.10.1",
"description": "Internationalize JS apps. This library provides an API to format dates, numbers, and strings, including pluralization and handling translations.",

@@ -33,7 +33,7 @@ "keywords": [

"@formatjs/ecma402-abstract": "1.6.5",
"@formatjs/icu-messageformat-parser": "1.1.6",
"@formatjs/fast-memoize": "1.1.0",
"@formatjs/icu-messageformat-parser": "1.2.0",
"@formatjs/intl-displaynames": "4.0.13",
"@formatjs/intl-listformat": "5.0.14",
"fast-memoize": "^2.5.2",
"intl-messageformat": "9.6.8",
"intl-messageformat": "9.6.9",
"tslib": "^2.1.0"

@@ -40,0 +40,0 @@ },

@@ -6,3 +6,3 @@ "use strict";

var intl_messageformat_1 = require("intl-messageformat");
var memoize = tslib_1.__importStar(require("fast-memoize"));
var fast_memoize_1 = tslib_1.__importStar(require("@formatjs/fast-memoize"));
var error_1 = require("./error");

@@ -64,5 +64,2 @@ function filterProps(props, whitelist, defaults) {

}
// @ts-ignore this is to deal with rollup's default import shenanigans
var _memoizeIntl = memoize.default || memoize;
var memoizeIntl = _memoizeIntl;
/**

@@ -77,3 +74,3 @@ * Create intl formatters and populate cache

var DisplayNames = Intl.DisplayNames;
var getDateTimeFormat = memoizeIntl(function () {
var getDateTimeFormat = fast_memoize_1.default(function () {
var _a;

@@ -87,5 +84,5 @@ var args = [];

cache: createFastMemoizeCache(cache.dateTime),
strategy: memoizeIntl.strategies.variadic,
strategy: fast_memoize_1.strategies.variadic,
});
var getNumberFormat = memoizeIntl(function () {
var getNumberFormat = fast_memoize_1.default(function () {
var _a;

@@ -99,5 +96,5 @@ var args = [];

cache: createFastMemoizeCache(cache.number),
strategy: memoizeIntl.strategies.variadic,
strategy: fast_memoize_1.strategies.variadic,
});
var getPluralRules = memoizeIntl(function () {
var getPluralRules = fast_memoize_1.default(function () {
var _a;

@@ -111,3 +108,3 @@ var args = [];

cache: createFastMemoizeCache(cache.pluralRules),
strategy: memoizeIntl.strategies.variadic,
strategy: fast_memoize_1.strategies.variadic,
});

@@ -117,3 +114,3 @@ return {

getNumberFormat: getNumberFormat,
getMessageFormat: memoizeIntl(function (message, locales, overrideFormats, opts) {
getMessageFormat: fast_memoize_1.default(function (message, locales, overrideFormats, opts) {
return new intl_messageformat_1.IntlMessageFormat(message, locales, overrideFormats, tslib_1.__assign({ formatters: {

@@ -126,5 +123,5 @@ getNumberFormat: getNumberFormat,

cache: createFastMemoizeCache(cache.message),
strategy: memoizeIntl.strategies.variadic,
strategy: fast_memoize_1.strategies.variadic,
}),
getRelativeTimeFormat: memoizeIntl(function () {
getRelativeTimeFormat: fast_memoize_1.default(function () {
var args = [];

@@ -137,6 +134,6 @@ for (var _i = 0; _i < arguments.length; _i++) {

cache: createFastMemoizeCache(cache.relativeTime),
strategy: memoizeIntl.strategies.variadic,
strategy: fast_memoize_1.strategies.variadic,
}),
getPluralRules: getPluralRules,
getListFormat: memoizeIntl(function () {
getListFormat: fast_memoize_1.default(function () {
var args = [];

@@ -149,5 +146,5 @@ for (var _i = 0; _i < arguments.length; _i++) {

cache: createFastMemoizeCache(cache.list),
strategy: memoizeIntl.strategies.variadic,
strategy: fast_memoize_1.strategies.variadic,
}),
getDisplayNames: memoizeIntl(function () {
getDisplayNames: fast_memoize_1.default(function () {
var args = [];

@@ -160,3 +157,3 @@ for (var _i = 0; _i < arguments.length; _i++) {

cache: createFastMemoizeCache(cache.displayNames),
strategy: memoizeIntl.strategies.variadic,
strategy: fast_memoize_1.strategies.variadic,
}),

@@ -163,0 +160,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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