intl-messageformat
Advanced tools
Comparing version 9.9.6 to 9.10.0
@@ -480,4 +480,4 @@ var __defProp = Object.defineProperty; | ||
var _a; | ||
var SPACE_SEPARATOR_START_REGEX = new RegExp("^" + SPACE_SEPARATOR_REGEX.source + "*"); | ||
var SPACE_SEPARATOR_END_REGEX = new RegExp(SPACE_SEPARATOR_REGEX.source + "*$"); | ||
var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*")); | ||
var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$")); | ||
function createLocation(start, end) { | ||
@@ -649,3 +649,3 @@ return { start, end }; | ||
type: TYPE.literal, | ||
value: "<" + tagName + "/>", | ||
value: "<".concat(tagName, "/>"), | ||
location: createLocation(startPosition, this.clonePosition()) | ||
@@ -1143,3 +1143,3 @@ }, | ||
if (code === void 0) { | ||
throw Error("Offset " + offset + " is at invalid UTF-16 code unit boundary"); | ||
throw Error("Offset ".concat(offset, " is at invalid UTF-16 code unit boundary")); | ||
} | ||
@@ -1194,3 +1194,3 @@ return code; | ||
if (this.offset() > targetOffset) { | ||
throw Error("targetOffset " + targetOffset + " must be greater than or equal to the current offset " + this.offset()); | ||
throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset())); | ||
} | ||
@@ -1204,3 +1204,3 @@ targetOffset = Math.min(targetOffset, this.message.length); | ||
if (offset > targetOffset) { | ||
throw Error("targetOffset " + targetOffset + " is at invalid UTF-16 code unit boundary"); | ||
throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary")); | ||
} | ||
@@ -1207,0 +1207,0 @@ this.bump(); |
@@ -20,3 +20,3 @@ import { __extends } from "tslib"; | ||
FormatError.prototype.toString = function () { | ||
return "[formatjs Error: " + this.code + "] " + this.message; | ||
return "[formatjs Error: ".concat(this.code, "] ").concat(this.message); | ||
}; | ||
@@ -29,3 +29,3 @@ return FormatError; | ||
function InvalidValueError(variableId, value, options, originalMessage) { | ||
return _super.call(this, "Invalid values for \"" + variableId + "\": \"" + value + "\". Options are \"" + Object.keys(options).join('", "') + "\"", ErrorCode.INVALID_VALUE, originalMessage) || this; | ||
return _super.call(this, "Invalid values for \"".concat(variableId, "\": \"").concat(value, "\". Options are \"").concat(Object.keys(options).join('", "'), "\""), ErrorCode.INVALID_VALUE, originalMessage) || this; | ||
} | ||
@@ -38,3 +38,3 @@ return InvalidValueError; | ||
function InvalidValueTypeError(value, type, originalMessage) { | ||
return _super.call(this, "Value for \"" + value + "\" must be of type " + type, ErrorCode.INVALID_VALUE, originalMessage) || this; | ||
return _super.call(this, "Value for \"".concat(value, "\" must be of type ").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this; | ||
} | ||
@@ -47,3 +47,3 @@ return InvalidValueTypeError; | ||
function MissingValueError(variableId, originalMessage) { | ||
return _super.call(this, "The intl string context variable \"" + variableId + "\" was not provided to the string \"" + originalMessage + "\"", ErrorCode.MISSING_VALUE, originalMessage) || this; | ||
return _super.call(this, "The intl string context variable \"".concat(variableId, "\" was not provided to the string \"").concat(originalMessage, "\""), ErrorCode.MISSING_VALUE, originalMessage) || this; | ||
} | ||
@@ -50,0 +50,0 @@ return MissingValueError; |
@@ -0,4 +1,5 @@ | ||
import { NumberFormatOptions } from '@formatjs/ecma402-abstract'; | ||
import { MessageFormatElement } from '@formatjs/icu-messageformat-parser'; | ||
export interface Formats { | ||
number: Record<string, Intl.NumberFormatOptions>; | ||
number: Record<string, NumberFormatOptions>; | ||
date: Record<string, Intl.DateTimeFormatOptions>; | ||
@@ -8,3 +9,3 @@ time: Record<string, Intl.DateTimeFormatOptions>; | ||
export interface FormatterCache { | ||
number: Record<string, Intl.NumberFormat>; | ||
number: Record<string, NumberFormatOptions>; | ||
dateTime: Record<string, Intl.DateTimeFormat>; | ||
@@ -14,3 +15,3 @@ pluralRules: Record<string, Intl.PluralRules>; | ||
export interface Formatters { | ||
getNumberFormat(...args: ConstructorParameters<typeof Intl.NumberFormat>): Intl.NumberFormat; | ||
getNumberFormat(locals?: string | string[], opts?: NumberFormatOptions): Intl.NumberFormat; | ||
getDateTimeFormat(...args: ConstructorParameters<typeof Intl.DateTimeFormat>): Intl.DateTimeFormat; | ||
@@ -17,0 +18,0 @@ getPluralRules(...args: ConstructorParameters<typeof Intl.PluralRules>): Intl.PluralRules; |
@@ -159,3 +159,3 @@ import { isArgumentElement, isDateElement, isDateTimeSkeleton, isLiteralElement, isNumberElement, isNumberSkeleton, isPluralElement, isPoundElement, isSelectElement, isTimeElement, isTagElement, } from '@formatjs/icu-messageformat-parser'; | ||
if (isPluralElement(el)) { | ||
var opt = el.options["=" + value]; | ||
var opt = el.options["=".concat(value)]; | ||
if (!opt) { | ||
@@ -162,0 +162,0 @@ if (!Intl.PluralRules) { |
{ | ||
"name": "intl-messageformat", | ||
"version": "9.9.6", | ||
"version": "9.10.0", | ||
"description": "Formats ICU Message strings with number, date, plural, and select placeholders to create localized messages.", | ||
@@ -34,4 +34,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@formatjs/ecma402-abstract": "1.11.0", | ||
"@formatjs/fast-memoize": "1.2.0", | ||
"@formatjs/icu-messageformat-parser": "2.0.14", | ||
"@formatjs/icu-messageformat-parser": "2.0.15", | ||
"tslib": "^2.1.0" | ||
@@ -38,0 +39,0 @@ }, |
@@ -23,3 +23,3 @@ "use strict"; | ||
FormatError.prototype.toString = function () { | ||
return "[formatjs Error: " + this.code + "] " + this.message; | ||
return "[formatjs Error: ".concat(this.code, "] ").concat(this.message); | ||
}; | ||
@@ -32,3 +32,3 @@ return FormatError; | ||
function InvalidValueError(variableId, value, options, originalMessage) { | ||
return _super.call(this, "Invalid values for \"" + variableId + "\": \"" + value + "\". Options are \"" + Object.keys(options).join('", "') + "\"", ErrorCode.INVALID_VALUE, originalMessage) || this; | ||
return _super.call(this, "Invalid values for \"".concat(variableId, "\": \"").concat(value, "\". Options are \"").concat(Object.keys(options).join('", "'), "\""), ErrorCode.INVALID_VALUE, originalMessage) || this; | ||
} | ||
@@ -41,3 +41,3 @@ return InvalidValueError; | ||
function InvalidValueTypeError(value, type, originalMessage) { | ||
return _super.call(this, "Value for \"" + value + "\" must be of type " + type, ErrorCode.INVALID_VALUE, originalMessage) || this; | ||
return _super.call(this, "Value for \"".concat(value, "\" must be of type ").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this; | ||
} | ||
@@ -50,3 +50,3 @@ return InvalidValueTypeError; | ||
function MissingValueError(variableId, originalMessage) { | ||
return _super.call(this, "The intl string context variable \"" + variableId + "\" was not provided to the string \"" + originalMessage + "\"", ErrorCode.MISSING_VALUE, originalMessage) || this; | ||
return _super.call(this, "The intl string context variable \"".concat(variableId, "\" was not provided to the string \"").concat(originalMessage, "\""), ErrorCode.MISSING_VALUE, originalMessage) || this; | ||
} | ||
@@ -53,0 +53,0 @@ return MissingValueError; |
@@ -0,4 +1,5 @@ | ||
import { NumberFormatOptions } from '@formatjs/ecma402-abstract'; | ||
import { MessageFormatElement } from '@formatjs/icu-messageformat-parser'; | ||
export interface Formats { | ||
number: Record<string, Intl.NumberFormatOptions>; | ||
number: Record<string, NumberFormatOptions>; | ||
date: Record<string, Intl.DateTimeFormatOptions>; | ||
@@ -8,3 +9,3 @@ time: Record<string, Intl.DateTimeFormatOptions>; | ||
export interface FormatterCache { | ||
number: Record<string, Intl.NumberFormat>; | ||
number: Record<string, NumberFormatOptions>; | ||
dateTime: Record<string, Intl.DateTimeFormat>; | ||
@@ -14,3 +15,3 @@ pluralRules: Record<string, Intl.PluralRules>; | ||
export interface Formatters { | ||
getNumberFormat(...args: ConstructorParameters<typeof Intl.NumberFormat>): Intl.NumberFormat; | ||
getNumberFormat(locals?: string | string[], opts?: NumberFormatOptions): Intl.NumberFormat; | ||
getDateTimeFormat(...args: ConstructorParameters<typeof Intl.DateTimeFormat>): Intl.DateTimeFormat; | ||
@@ -17,0 +18,0 @@ getPluralRules(...args: ConstructorParameters<typeof Intl.PluralRules>): Intl.PluralRules; |
@@ -163,3 +163,3 @@ "use strict"; | ||
if ((0, icu_messageformat_parser_1.isPluralElement)(el)) { | ||
var opt = el.options["=" + value]; | ||
var opt = el.options["=".concat(value)]; | ||
if (!opt) { | ||
@@ -166,0 +166,0 @@ if (!Intl.PluralRules) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
190819
4670
4
+ Added@formatjs/ecma402-abstract@1.11.0(transitive)
+ Added@formatjs/icu-messageformat-parser@2.0.15(transitive)
+ Added@formatjs/icu-skeleton-parser@1.3.2(transitive)
- Removed@formatjs/ecma402-abstract@1.10.0(transitive)
- Removed@formatjs/icu-messageformat-parser@2.0.14(transitive)
- Removed@formatjs/icu-skeleton-parser@1.3.1(transitive)