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

react-intl

Package Overview
Dependencies
Maintainers
8
Versions
345
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-intl - npm Package Compare versions

Comparing version 7.0.0 to 7.0.1

3

index.d.ts

@@ -1,2 +0,1 @@

import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
import { CustomFormatConfig, FormatDateOptions, MessageDescriptor } from '@formatjs/intl';

@@ -25,3 +24,3 @@ import * as React from 'react';

}>;
export declare const FormattedNumber: React.FC<Omit<NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig<'number'> & {
export declare const FormattedNumber: React.FC<Omit<Intl.NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig<'number'> & {
value: number;

@@ -28,0 +27,0 @@ children?(formattedNumber: string): React.ReactElement | null;

@@ -1,2 +0,1 @@

import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
import { CustomFormatConfig, FormatDateOptions, MessageDescriptor } from '@formatjs/intl';

@@ -25,3 +24,3 @@ import * as React from 'react';

}>;
export declare const FormattedNumber: React.FC<Omit<NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig<'number'> & {
export declare const FormattedNumber: React.FC<Omit<Intl.NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig<'number'> & {
value: number;

@@ -28,0 +27,0 @@ children?(formattedNumber: string): React.ReactElement | null;

@@ -8,5 +8,5 @@ /*

import { createIntl as coreCreateIntl, formatMessage as coreFormatMessage, } from '@formatjs/intl';
import { isFormatXMLElementFn, } from 'intl-messageformat';
import * as React from 'react';
import { DEFAULT_INTL_CONFIG, assignUniqueKeysToParts } from '../utils';
import { isFormatXMLElementFn, } from 'intl-messageformat';
function assignUniqueKeysToFormatXMLElementFnArgument(values) {

@@ -59,7 +59,3 @@ if (!values) {

};
return __assign(__assign({}, coreIntl), { formatMessage: formatMessage.bind(null, resolvedConfig,
// @ts-expect-error fix this
coreIntl.formatters),
// @ts-expect-error fix this
$t: formatMessage.bind(null, resolvedConfig, coreIntl.formatters) });
return __assign(__assign({}, coreIntl), { formatMessage: formatMessage.bind(null, resolvedConfig, coreIntl.formatters), $t: formatMessage.bind(null, resolvedConfig, coreIntl.formatters) });
};

@@ -0,7 +1,6 @@

import { FormatDateOptions } from '@formatjs/intl';
import * as React from 'react';
import { FormatDateOptions } from '@formatjs/intl';
import { DateTimeFormat } from '@formatjs/ecma402-abstract';
interface Props extends FormatDateOptions {
from: Parameters<DateTimeFormat['formatRange']>[0];
to: Parameters<DateTimeFormat['formatRange']>[1];
from: Parameters<Intl.DateTimeFormat['formatRange']>[0];
to: Parameters<Intl.DateTimeFormat['formatRange']>[1];
children?(value: React.ReactNode): React.ReactElement | null;

@@ -8,0 +7,0 @@ }

import * as React from 'react';
import { RelativeTimeFormatSingularUnit } from '@formatjs/ecma402-abstract';
import { FormatRelativeTimeOptions } from '@formatjs/intl';
export interface Props extends FormatRelativeTimeOptions {
value?: number;
unit?: RelativeTimeFormatSingularUnit;
unit?: Intl.RelativeTimeFormatUnit;
updateIntervalInSeconds?: number;

@@ -8,0 +7,0 @@ children?(value: string): React.ReactElement | null;

@@ -8,3 +8,3 @@ import { __assign, __rest } from "tslib";

import * as React from 'react';
import { invariant, } from '@formatjs/ecma402-abstract';
import { invariant } from '../utils';
import useIntl from './useIntl';

@@ -11,0 +11,0 @@ var MINUTE = 60;

@@ -0,4 +1,5 @@

import { FormatXMLElementFn } from 'intl-messageformat';
import * as React from 'react';
import { ResolvedIntlConfig } from './types';
import * as React from 'react';
import { FormatXMLElementFn } from 'intl-messageformat';
export declare function invariant(condition: boolean, message: string, Err?: any): asserts condition;
export declare function invariantIntlContext(intl?: any): asserts intl;

@@ -5,0 +6,0 @@ export declare const DEFAULT_INTL_CONFIG: Pick<ResolvedIntlConfig, 'fallbackOnEmptyString' | 'formats' | 'messages' | 'timeZone' | 'textComponent' | 'defaultLocale' | 'defaultFormats' | 'onError'>;

import { __assign } from "tslib";
import * as React from 'react';
import { invariant } from '@formatjs/ecma402-abstract';
import { DEFAULT_INTL_CONFIG as CORE_DEFAULT_INTL_CONFIG } from '@formatjs/intl';
export function invariant(condition, message, Err) {
if (Err === void 0) { Err = Error; }
if (!condition) {
throw new Err(message);
}
}
export function invariantIntlContext(intl) {

@@ -6,0 +11,0 @@ invariant(intl, '[React Intl] Could not find required `intl` object. ' +

{
"name": "react-intl",
"version": "7.0.0",
"version": "7.0.1",
"description": "Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.",

@@ -136,5 +136,4 @@ "keywords": [

"intl-messageformat": "10.7.7",
"@formatjs/intl": "3.0.0",
"@formatjs/icu-messageformat-parser": "2.9.4",
"@formatjs/ecma402-abstract": "2.2.4"
"@formatjs/intl": "3.0.1"
},

@@ -141,0 +140,0 @@ "peerDependencies": {

@@ -11,5 +11,5 @@ "use strict";

var intl_1 = require("@formatjs/intl");
var intl_messageformat_1 = require("intl-messageformat");
var React = tslib_1.__importStar(require("react"));
var utils_1 = require("../utils");
var intl_messageformat_1 = require("intl-messageformat");
function assignUniqueKeysToFormatXMLElementFnArgument(values) {

@@ -62,8 +62,4 @@ if (!values) {

};
return tslib_1.__assign(tslib_1.__assign({}, coreIntl), { formatMessage: formatMessage.bind(null, resolvedConfig,
// @ts-expect-error fix this
coreIntl.formatters),
// @ts-expect-error fix this
$t: formatMessage.bind(null, resolvedConfig, coreIntl.formatters) });
return tslib_1.__assign(tslib_1.__assign({}, coreIntl), { formatMessage: formatMessage.bind(null, resolvedConfig, coreIntl.formatters), $t: formatMessage.bind(null, resolvedConfig, coreIntl.formatters) });
};
exports.createIntl = createIntl;

@@ -0,7 +1,6 @@

import { FormatDateOptions } from '@formatjs/intl';
import * as React from 'react';
import { FormatDateOptions } from '@formatjs/intl';
import { DateTimeFormat } from '@formatjs/ecma402-abstract';
interface Props extends FormatDateOptions {
from: Parameters<DateTimeFormat['formatRange']>[0];
to: Parameters<DateTimeFormat['formatRange']>[1];
from: Parameters<Intl.DateTimeFormat['formatRange']>[0];
to: Parameters<Intl.DateTimeFormat['formatRange']>[1];
children?(value: React.ReactNode): React.ReactElement | null;

@@ -8,0 +7,0 @@ }

import * as React from 'react';
import { RelativeTimeFormatSingularUnit } from '@formatjs/ecma402-abstract';
import { FormatRelativeTimeOptions } from '@formatjs/intl';
export interface Props extends FormatRelativeTimeOptions {
value?: number;
unit?: RelativeTimeFormatSingularUnit;
unit?: Intl.RelativeTimeFormatUnit;
updateIntervalInSeconds?: number;

@@ -8,0 +7,0 @@ children?(value: string): React.ReactElement | null;

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

var React = tslib_1.__importStar(require("react"));
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
var utils_1 = require("../utils");
var useIntl_1 = tslib_1.__importDefault(require("./useIntl"));

@@ -77,3 +77,3 @@ var MINUTE = 60;

var _b = _a.value, value = _b === void 0 ? 0 : _b, _c = _a.unit, unit = _c === void 0 ? 'second' : _c, updateIntervalInSeconds = _a.updateIntervalInSeconds, otherProps = tslib_1.__rest(_a, ["value", "unit", "updateIntervalInSeconds"]);
(0, ecma402_abstract_1.invariant)(!updateIntervalInSeconds ||
(0, utils_1.invariant)(!updateIntervalInSeconds ||
!!(updateIntervalInSeconds && canIncrement(unit)), 'Cannot schedule update with unit longer than hour');

@@ -80,0 +80,0 @@ var _d = React.useState(), prevUnit = _d[0], setPrevUnit = _d[1];

@@ -0,4 +1,5 @@

import { FormatXMLElementFn } from 'intl-messageformat';
import * as React from 'react';
import { ResolvedIntlConfig } from './types';
import * as React from 'react';
import { FormatXMLElementFn } from 'intl-messageformat';
export declare function invariant(condition: boolean, message: string, Err?: any): asserts condition;
export declare function invariantIntlContext(intl?: any): asserts intl;

@@ -5,0 +6,0 @@ export declare const DEFAULT_INTL_CONFIG: Pick<ResolvedIntlConfig, 'fallbackOnEmptyString' | 'formats' | 'messages' | 'timeZone' | 'textComponent' | 'defaultLocale' | 'defaultFormats' | 'onError'>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_INTL_CONFIG = void 0;
exports.invariant = invariant;
exports.invariantIntlContext = invariantIntlContext;

@@ -9,6 +10,11 @@ exports.assignUniqueKeysToParts = assignUniqueKeysToParts;

var React = tslib_1.__importStar(require("react"));
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
var intl_1 = require("@formatjs/intl");
function invariant(condition, message, Err) {
if (Err === void 0) { Err = Error; }
if (!condition) {
throw new Err(message);
}
}
function invariantIntlContext(intl) {
(0, ecma402_abstract_1.invariant)(intl, '[React Intl] Could not find required `intl` object. ' +
invariant(intl, '[React Intl] Could not find required `intl` object. ' +
'<IntlProvider> needs to exist in the component ancestry.');

@@ -15,0 +21,0 @@ }

Sorry, the diff of this file is too big to display

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