New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

use-intl

Package Overview
Dependencies
Maintainers
0
Versions
285
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-intl - npm Package Compare versions

Comparing version 4.0.0-beta-00a79d4 to 4.0.0-beta-5a7f7be

15

dist/esm/development/core.js

@@ -61,20 +61,5 @@ import { r as resolveNamespace, e as createBaseTranslator, d as createCache, b as createIntlFormatters, f as defaultGetMessageFallback, g as defaultOnError } from './initializeConfig-DSmAVNvj.js';

*
* Additionally, in development, the provided locales are validated to
* ensure they follow the Unicode language identifier standard.
*
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale
*/
function hasLocale(locales, candidate) {
{
for (const locale of locales) {
try {
const constructed = new Intl.Locale(locale);
if (!constructed.language) {
throw new Error('Language is required');
}
} catch {
console.error(`Found invalid locale within provided \`locales\`: "${locale}"\nPlease ensure you're using a valid Unicode locale identifier (e.g. "en-US").`);
}
}
}
return locales.includes(candidate);

@@ -81,0 +66,0 @@ }

8

dist/types/core/createTranslator.d.ts

@@ -8,9 +8,9 @@ import type { ReactNode } from 'react';

import type { MessageKeys, NamespaceKeys, NestedKeyOf, NestedValueOf } from './MessageKeys.tsx';
import type { ICUArg, ICUDate, ICUNumber, MarkupTagsFunction, RichTagsFunction } from './TranslationValues.tsx';
import type { ICUArg, MarkupTagsFunction, RichTagsFunction } from './TranslationValues.tsx';
import { type Formatters, type IntlCache } from './formatters.tsx';
import type { Prettify } from './types.tsx';
type ICUArgsWithTags<MessageString extends string, TagsFn extends RichTagsFunction | MarkupTagsFunction = never> = ICUArgs<MessageString, {
ICUArgument: ICUArg;
ICUNumberArgument: ICUNumber;
ICUDateArgument: ICUDate;
ICUArgument: string | number | boolean | Date;
ICUNumberArgument: number;
ICUDateArgument: Date | number;
}> & ([TagsFn] extends [never] ? {} : ICUTags<MessageString, TagsFn>);

@@ -17,0 +17,0 @@ type OnlyOptional<T> = Partial<T> extends T ? true : false;

@@ -5,7 +5,4 @@ import type { Locale } from './AppConfig.tsx';

*
* Additionally, in development, the provided locales are validated to
* ensure they follow the Unicode language identifier standard.
*
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale
*/
export default function hasLocale<LocaleType extends Locale>(locales: ReadonlyArray<LocaleType>, candidate?: string | null): candidate is LocaleType;
export type { default as AbstractIntlMessages } from './AbstractIntlMessages.tsx';
export type { TranslationValues, RichTranslationValues, MarkupTranslationValues, ICUArg, ICUNumber, ICUDate, RichTagsFunction, MarkupTagsFunction } from './TranslationValues.tsx';
export type { TranslationValues, ICUArg, RichTranslationValues, MarkupTranslationValues, RichTagsFunction, MarkupTagsFunction } from './TranslationValues.tsx';
export type { default as Formats } from './Formats.tsx';

@@ -4,0 +4,0 @@ export type { default as IntlConfig } from './IntlConfig.tsx';

import type { ReactNode } from 'react';
export type ICUArg = string | number | boolean | Date;
export type ICUNumber = number;
export type ICUDate = Date | number | string;
export type TranslationValues = Record<string, ICUArg>;

@@ -6,0 +4,0 @@ export type RichTagsFunction = (chunks: ReactNode) => ReactNode;

{
"name": "use-intl",
"version": "4.0.0-beta-00a79d4",
"version": "4.0.0-beta-5a7f7be",
"sideEffects": false,

@@ -67,3 +67,3 @@ "author": "Jan Amann <jan@amann.work>",

},
"gitHead": "9c05cd576d214480f7459b2351f94cfa9e4aef85"
"gitHead": "909c2b718d71f4318999b31f783332615f4e59f8"
}
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