intl-messageformat 10.5.14 → 10.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/intl-messageformat.esm.js +67 -67
- package/intl-messageformat.iife.js +67 -67
- package/lib/src/core.d.ts +2 -2
- package/lib/src/core.js +1 -1
- package/package.json +3 -3
- package/src/core.d.ts +2 -2
- package/src/core.js +1 -1
|
@@ -5,6 +5,73 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/lib/index.js
|
|
9
|
+
function memoize(fn, options) {
|
|
10
|
+
var cache = options && options.cache ? options.cache : cacheDefault;
|
|
11
|
+
var serializer = options && options.serializer ? options.serializer : serializerDefault;
|
|
12
|
+
var strategy = options && options.strategy ? options.strategy : strategyDefault;
|
|
13
|
+
return strategy(fn, {
|
|
14
|
+
cache,
|
|
15
|
+
serializer
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function isPrimitive(value) {
|
|
19
|
+
return value == null || typeof value === "number" || typeof value === "boolean";
|
|
20
|
+
}
|
|
21
|
+
function monadic(fn, cache, serializer, arg) {
|
|
22
|
+
var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
|
|
23
|
+
var computedValue = cache.get(cacheKey);
|
|
24
|
+
if (typeof computedValue === "undefined") {
|
|
25
|
+
computedValue = fn.call(this, arg);
|
|
26
|
+
cache.set(cacheKey, computedValue);
|
|
27
|
+
}
|
|
28
|
+
return computedValue;
|
|
29
|
+
}
|
|
30
|
+
function variadic(fn, cache, serializer) {
|
|
31
|
+
var args = Array.prototype.slice.call(arguments, 3);
|
|
32
|
+
var cacheKey = serializer(args);
|
|
33
|
+
var computedValue = cache.get(cacheKey);
|
|
34
|
+
if (typeof computedValue === "undefined") {
|
|
35
|
+
computedValue = fn.apply(this, args);
|
|
36
|
+
cache.set(cacheKey, computedValue);
|
|
37
|
+
}
|
|
38
|
+
return computedValue;
|
|
39
|
+
}
|
|
40
|
+
function assemble(fn, context, strategy, cache, serialize) {
|
|
41
|
+
return strategy.bind(context, fn, cache, serialize);
|
|
42
|
+
}
|
|
43
|
+
function strategyDefault(fn, options) {
|
|
44
|
+
var strategy = fn.length === 1 ? monadic : variadic;
|
|
45
|
+
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
|
|
46
|
+
}
|
|
47
|
+
function strategyVariadic(fn, options) {
|
|
48
|
+
return assemble(fn, this, variadic, options.cache.create(), options.serializer);
|
|
49
|
+
}
|
|
50
|
+
function strategyMonadic(fn, options) {
|
|
51
|
+
return assemble(fn, this, monadic, options.cache.create(), options.serializer);
|
|
52
|
+
}
|
|
53
|
+
var serializerDefault = function() {
|
|
54
|
+
return JSON.stringify(arguments);
|
|
55
|
+
};
|
|
56
|
+
function ObjectWithoutPrototypeCache() {
|
|
57
|
+
this.cache = /* @__PURE__ */ Object.create(null);
|
|
58
|
+
}
|
|
59
|
+
ObjectWithoutPrototypeCache.prototype.get = function(key) {
|
|
60
|
+
return this.cache[key];
|
|
61
|
+
};
|
|
62
|
+
ObjectWithoutPrototypeCache.prototype.set = function(key, value) {
|
|
63
|
+
this.cache[key] = value;
|
|
64
|
+
};
|
|
65
|
+
var cacheDefault = {
|
|
66
|
+
create: function create() {
|
|
67
|
+
return new ObjectWithoutPrototypeCache();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var strategies = {
|
|
71
|
+
variadic: strategyVariadic,
|
|
72
|
+
monadic: strategyMonadic
|
|
73
|
+
};
|
|
74
|
+
|
|
8
75
|
// ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/tslib@2.4.0/node_modules/tslib/tslib.es6.js
|
|
9
76
|
var __assign = function() {
|
|
10
77
|
__assign = Object.assign || function __assign2(t) {
|
|
@@ -2810,73 +2877,6 @@ function parse(message, opts) {
|
|
|
2810
2877
|
return result.val;
|
|
2811
2878
|
}
|
|
2812
2879
|
|
|
2813
|
-
// ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/lib/index.js
|
|
2814
|
-
function memoize(fn, options) {
|
|
2815
|
-
var cache = options && options.cache ? options.cache : cacheDefault;
|
|
2816
|
-
var serializer = options && options.serializer ? options.serializer : serializerDefault;
|
|
2817
|
-
var strategy = options && options.strategy ? options.strategy : strategyDefault;
|
|
2818
|
-
return strategy(fn, {
|
|
2819
|
-
cache,
|
|
2820
|
-
serializer
|
|
2821
|
-
});
|
|
2822
|
-
}
|
|
2823
|
-
function isPrimitive(value) {
|
|
2824
|
-
return value == null || typeof value === "number" || typeof value === "boolean";
|
|
2825
|
-
}
|
|
2826
|
-
function monadic(fn, cache, serializer, arg) {
|
|
2827
|
-
var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
|
|
2828
|
-
var computedValue = cache.get(cacheKey);
|
|
2829
|
-
if (typeof computedValue === "undefined") {
|
|
2830
|
-
computedValue = fn.call(this, arg);
|
|
2831
|
-
cache.set(cacheKey, computedValue);
|
|
2832
|
-
}
|
|
2833
|
-
return computedValue;
|
|
2834
|
-
}
|
|
2835
|
-
function variadic(fn, cache, serializer) {
|
|
2836
|
-
var args = Array.prototype.slice.call(arguments, 3);
|
|
2837
|
-
var cacheKey = serializer(args);
|
|
2838
|
-
var computedValue = cache.get(cacheKey);
|
|
2839
|
-
if (typeof computedValue === "undefined") {
|
|
2840
|
-
computedValue = fn.apply(this, args);
|
|
2841
|
-
cache.set(cacheKey, computedValue);
|
|
2842
|
-
}
|
|
2843
|
-
return computedValue;
|
|
2844
|
-
}
|
|
2845
|
-
function assemble(fn, context, strategy, cache, serialize) {
|
|
2846
|
-
return strategy.bind(context, fn, cache, serialize);
|
|
2847
|
-
}
|
|
2848
|
-
function strategyDefault(fn, options) {
|
|
2849
|
-
var strategy = fn.length === 1 ? monadic : variadic;
|
|
2850
|
-
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
|
|
2851
|
-
}
|
|
2852
|
-
function strategyVariadic(fn, options) {
|
|
2853
|
-
return assemble(fn, this, variadic, options.cache.create(), options.serializer);
|
|
2854
|
-
}
|
|
2855
|
-
function strategyMonadic(fn, options) {
|
|
2856
|
-
return assemble(fn, this, monadic, options.cache.create(), options.serializer);
|
|
2857
|
-
}
|
|
2858
|
-
var serializerDefault = function() {
|
|
2859
|
-
return JSON.stringify(arguments);
|
|
2860
|
-
};
|
|
2861
|
-
function ObjectWithoutPrototypeCache() {
|
|
2862
|
-
this.cache = /* @__PURE__ */ Object.create(null);
|
|
2863
|
-
}
|
|
2864
|
-
ObjectWithoutPrototypeCache.prototype.get = function(key) {
|
|
2865
|
-
return this.cache[key];
|
|
2866
|
-
};
|
|
2867
|
-
ObjectWithoutPrototypeCache.prototype.set = function(key, value) {
|
|
2868
|
-
this.cache[key] = value;
|
|
2869
|
-
};
|
|
2870
|
-
var cacheDefault = {
|
|
2871
|
-
create: function create() {
|
|
2872
|
-
return new ObjectWithoutPrototypeCache();
|
|
2873
|
-
}
|
|
2874
|
-
};
|
|
2875
|
-
var strategies = {
|
|
2876
|
-
variadic: strategyVariadic,
|
|
2877
|
-
monadic: strategyMonadic
|
|
2878
|
-
};
|
|
2879
|
-
|
|
2880
2880
|
// ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/packages/intl-messageformat/lib_esnext/src/error.js
|
|
2881
2881
|
var ErrorCode;
|
|
2882
2882
|
(function(ErrorCode2) {
|
|
@@ -88,6 +88,73 @@ var IntlMessageFormat = (() => {
|
|
|
88
88
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/lib/index.js
|
|
92
|
+
function memoize(fn, options) {
|
|
93
|
+
var cache = options && options.cache ? options.cache : cacheDefault;
|
|
94
|
+
var serializer = options && options.serializer ? options.serializer : serializerDefault;
|
|
95
|
+
var strategy = options && options.strategy ? options.strategy : strategyDefault;
|
|
96
|
+
return strategy(fn, {
|
|
97
|
+
cache,
|
|
98
|
+
serializer
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function isPrimitive(value) {
|
|
102
|
+
return value == null || typeof value === "number" || typeof value === "boolean";
|
|
103
|
+
}
|
|
104
|
+
function monadic(fn, cache, serializer, arg) {
|
|
105
|
+
var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
|
|
106
|
+
var computedValue = cache.get(cacheKey);
|
|
107
|
+
if (typeof computedValue === "undefined") {
|
|
108
|
+
computedValue = fn.call(this, arg);
|
|
109
|
+
cache.set(cacheKey, computedValue);
|
|
110
|
+
}
|
|
111
|
+
return computedValue;
|
|
112
|
+
}
|
|
113
|
+
function variadic(fn, cache, serializer) {
|
|
114
|
+
var args = Array.prototype.slice.call(arguments, 3);
|
|
115
|
+
var cacheKey = serializer(args);
|
|
116
|
+
var computedValue = cache.get(cacheKey);
|
|
117
|
+
if (typeof computedValue === "undefined") {
|
|
118
|
+
computedValue = fn.apply(this, args);
|
|
119
|
+
cache.set(cacheKey, computedValue);
|
|
120
|
+
}
|
|
121
|
+
return computedValue;
|
|
122
|
+
}
|
|
123
|
+
function assemble(fn, context, strategy, cache, serialize) {
|
|
124
|
+
return strategy.bind(context, fn, cache, serialize);
|
|
125
|
+
}
|
|
126
|
+
function strategyDefault(fn, options) {
|
|
127
|
+
var strategy = fn.length === 1 ? monadic : variadic;
|
|
128
|
+
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
|
|
129
|
+
}
|
|
130
|
+
function strategyVariadic(fn, options) {
|
|
131
|
+
return assemble(fn, this, variadic, options.cache.create(), options.serializer);
|
|
132
|
+
}
|
|
133
|
+
function strategyMonadic(fn, options) {
|
|
134
|
+
return assemble(fn, this, monadic, options.cache.create(), options.serializer);
|
|
135
|
+
}
|
|
136
|
+
var serializerDefault = function() {
|
|
137
|
+
return JSON.stringify(arguments);
|
|
138
|
+
};
|
|
139
|
+
function ObjectWithoutPrototypeCache() {
|
|
140
|
+
this.cache = /* @__PURE__ */ Object.create(null);
|
|
141
|
+
}
|
|
142
|
+
ObjectWithoutPrototypeCache.prototype.get = function(key) {
|
|
143
|
+
return this.cache[key];
|
|
144
|
+
};
|
|
145
|
+
ObjectWithoutPrototypeCache.prototype.set = function(key, value) {
|
|
146
|
+
this.cache[key] = value;
|
|
147
|
+
};
|
|
148
|
+
var cacheDefault = {
|
|
149
|
+
create: function create() {
|
|
150
|
+
return new ObjectWithoutPrototypeCache();
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
var strategies = {
|
|
154
|
+
variadic: strategyVariadic,
|
|
155
|
+
monadic: strategyMonadic
|
|
156
|
+
};
|
|
157
|
+
|
|
91
158
|
// ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/error.js
|
|
92
159
|
var ErrorKind;
|
|
93
160
|
(function(ErrorKind2) {
|
|
@@ -2879,73 +2946,6 @@ var IntlMessageFormat = (() => {
|
|
|
2879
2946
|
return result.val;
|
|
2880
2947
|
}
|
|
2881
2948
|
|
|
2882
|
-
// ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/lib/index.js
|
|
2883
|
-
function memoize(fn, options) {
|
|
2884
|
-
var cache = options && options.cache ? options.cache : cacheDefault;
|
|
2885
|
-
var serializer = options && options.serializer ? options.serializer : serializerDefault;
|
|
2886
|
-
var strategy = options && options.strategy ? options.strategy : strategyDefault;
|
|
2887
|
-
return strategy(fn, {
|
|
2888
|
-
cache,
|
|
2889
|
-
serializer
|
|
2890
|
-
});
|
|
2891
|
-
}
|
|
2892
|
-
function isPrimitive(value) {
|
|
2893
|
-
return value == null || typeof value === "number" || typeof value === "boolean";
|
|
2894
|
-
}
|
|
2895
|
-
function monadic(fn, cache, serializer, arg) {
|
|
2896
|
-
var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
|
|
2897
|
-
var computedValue = cache.get(cacheKey);
|
|
2898
|
-
if (typeof computedValue === "undefined") {
|
|
2899
|
-
computedValue = fn.call(this, arg);
|
|
2900
|
-
cache.set(cacheKey, computedValue);
|
|
2901
|
-
}
|
|
2902
|
-
return computedValue;
|
|
2903
|
-
}
|
|
2904
|
-
function variadic(fn, cache, serializer) {
|
|
2905
|
-
var args = Array.prototype.slice.call(arguments, 3);
|
|
2906
|
-
var cacheKey = serializer(args);
|
|
2907
|
-
var computedValue = cache.get(cacheKey);
|
|
2908
|
-
if (typeof computedValue === "undefined") {
|
|
2909
|
-
computedValue = fn.apply(this, args);
|
|
2910
|
-
cache.set(cacheKey, computedValue);
|
|
2911
|
-
}
|
|
2912
|
-
return computedValue;
|
|
2913
|
-
}
|
|
2914
|
-
function assemble(fn, context, strategy, cache, serialize) {
|
|
2915
|
-
return strategy.bind(context, fn, cache, serialize);
|
|
2916
|
-
}
|
|
2917
|
-
function strategyDefault(fn, options) {
|
|
2918
|
-
var strategy = fn.length === 1 ? monadic : variadic;
|
|
2919
|
-
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
|
|
2920
|
-
}
|
|
2921
|
-
function strategyVariadic(fn, options) {
|
|
2922
|
-
return assemble(fn, this, variadic, options.cache.create(), options.serializer);
|
|
2923
|
-
}
|
|
2924
|
-
function strategyMonadic(fn, options) {
|
|
2925
|
-
return assemble(fn, this, monadic, options.cache.create(), options.serializer);
|
|
2926
|
-
}
|
|
2927
|
-
var serializerDefault = function() {
|
|
2928
|
-
return JSON.stringify(arguments);
|
|
2929
|
-
};
|
|
2930
|
-
function ObjectWithoutPrototypeCache() {
|
|
2931
|
-
this.cache = /* @__PURE__ */ Object.create(null);
|
|
2932
|
-
}
|
|
2933
|
-
ObjectWithoutPrototypeCache.prototype.get = function(key) {
|
|
2934
|
-
return this.cache[key];
|
|
2935
|
-
};
|
|
2936
|
-
ObjectWithoutPrototypeCache.prototype.set = function(key, value) {
|
|
2937
|
-
this.cache[key] = value;
|
|
2938
|
-
};
|
|
2939
|
-
var cacheDefault = {
|
|
2940
|
-
create: function create() {
|
|
2941
|
-
return new ObjectWithoutPrototypeCache();
|
|
2942
|
-
}
|
|
2943
|
-
};
|
|
2944
|
-
var strategies = {
|
|
2945
|
-
variadic: strategyVariadic,
|
|
2946
|
-
monadic: strategyMonadic
|
|
2947
|
-
};
|
|
2948
|
-
|
|
2949
2949
|
// ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/packages/intl-messageformat/lib/src/error.js
|
|
2950
2950
|
var ErrorCode;
|
|
2951
2951
|
(function(ErrorCode2) {
|
package/lib/src/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { MessageFormatElement, parse, ParserOptions } from '@formatjs/icu-messageformat-parser';
|
|
2
|
+
import { Formats, Formatters, FormatXMLElementFn, MessageFormatPart, PrimitiveType } from './formatters';
|
|
3
3
|
export interface Options extends Omit<ParserOptions, 'locale'> {
|
|
4
4
|
formatters?: Formatters;
|
|
5
5
|
}
|
package/lib/src/core.js
CHANGED
|
@@ -4,8 +4,8 @@ Copyrights licensed under the New BSD License.
|
|
|
4
4
|
See the accompanying LICENSE file for terms.
|
|
5
5
|
*/
|
|
6
6
|
import { __assign, __rest, __spreadArray } from "tslib";
|
|
7
|
-
import { parse, } from '@formatjs/icu-messageformat-parser';
|
|
8
7
|
import { memoize, strategies } from '@formatjs/fast-memoize';
|
|
8
|
+
import { parse, } from '@formatjs/icu-messageformat-parser';
|
|
9
9
|
import { formatToParts, PART_TYPE, } from './formatters';
|
|
10
10
|
// -- MessageFormat --------------------------------------------------------
|
|
11
11
|
function mergeConfig(c1, c2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intl-messageformat",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.6.0",
|
|
4
4
|
"description": "Formats ICU Message strings with number, date, plural, and select placeholders to create localized messages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"i18n",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"types": "index.d.ts",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"tslib": "^2.4.0",
|
|
35
|
-
"@formatjs/ecma402-abstract": "2.
|
|
36
|
-
"@formatjs/icu-messageformat-parser": "2.7.
|
|
35
|
+
"@formatjs/ecma402-abstract": "2.1.0",
|
|
36
|
+
"@formatjs/icu-messageformat-parser": "2.7.9",
|
|
37
37
|
"@formatjs/fast-memoize": "2.2.0"
|
|
38
38
|
},
|
|
39
39
|
"sideEffects": false,
|
package/src/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { MessageFormatElement, parse, ParserOptions } from '@formatjs/icu-messageformat-parser';
|
|
2
|
+
import { Formats, Formatters, FormatXMLElementFn, MessageFormatPart, PrimitiveType } from './formatters';
|
|
3
3
|
export interface Options extends Omit<ParserOptions, 'locale'> {
|
|
4
4
|
formatters?: Formatters;
|
|
5
5
|
}
|
package/src/core.js
CHANGED
|
@@ -7,8 +7,8 @@ See the accompanying LICENSE file for terms.
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.IntlMessageFormat = void 0;
|
|
9
9
|
var tslib_1 = require("tslib");
|
|
10
|
-
var icu_messageformat_parser_1 = require("@formatjs/icu-messageformat-parser");
|
|
11
10
|
var fast_memoize_1 = require("@formatjs/fast-memoize");
|
|
11
|
+
var icu_messageformat_parser_1 = require("@formatjs/icu-messageformat-parser");
|
|
12
12
|
var formatters_1 = require("./formatters");
|
|
13
13
|
// -- MessageFormat --------------------------------------------------------
|
|
14
14
|
function mergeConfig(c1, c2) {
|