@formatjs/intl-pluralrules 5.2.13 → 5.2.15

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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/polyfill.iife.js +117 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formatjs/intl-pluralrules",
3
- "version": "5.2.13",
3
+ "version": "5.2.15",
4
4
  "description": "Polyfill for Intl.PluralRules",
5
5
  "keywords": [
6
6
  "polyfill",
@@ -21,12 +21,12 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "tslib": "^2.4.0",
24
- "@formatjs/ecma402-abstract": "1.18.3",
24
+ "@formatjs/ecma402-abstract": "2.1.0",
25
25
  "@formatjs/intl-localematcher": "0.5.4"
26
26
  },
27
27
  "devDependencies": {
28
- "@formatjs/intl-locale": "3.4.6",
29
- "@formatjs/intl-getcanonicallocales": "2.3.0"
28
+ "@formatjs/intl-getcanonicallocales": "2.3.0",
29
+ "@formatjs/intl-locale": "4.0.1"
30
30
  },
31
31
  "bugs": {
32
32
  "url": "https://github.com/formatjs/formatjs/issues"
package/polyfill.iife.js CHANGED
@@ -211,6 +211,73 @@
211
211
  }
212
212
  var SIMPLE_UNITS = SANCTIONED_UNITS.map(removeUnitNamespace);
213
213
 
214
+ // ../../../../../../../../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
215
+ function memoize(fn, options) {
216
+ var cache = options && options.cache ? options.cache : cacheDefault;
217
+ var serializer = options && options.serializer ? options.serializer : serializerDefault;
218
+ var strategy = options && options.strategy ? options.strategy : strategyDefault;
219
+ return strategy(fn, {
220
+ cache,
221
+ serializer
222
+ });
223
+ }
224
+ function isPrimitive(value) {
225
+ return value == null || typeof value === "number" || typeof value === "boolean";
226
+ }
227
+ function monadic(fn, cache, serializer, arg) {
228
+ var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
229
+ var computedValue = cache.get(cacheKey);
230
+ if (typeof computedValue === "undefined") {
231
+ computedValue = fn.call(this, arg);
232
+ cache.set(cacheKey, computedValue);
233
+ }
234
+ return computedValue;
235
+ }
236
+ function variadic(fn, cache, serializer) {
237
+ var args = Array.prototype.slice.call(arguments, 3);
238
+ var cacheKey = serializer(args);
239
+ var computedValue = cache.get(cacheKey);
240
+ if (typeof computedValue === "undefined") {
241
+ computedValue = fn.apply(this, args);
242
+ cache.set(cacheKey, computedValue);
243
+ }
244
+ return computedValue;
245
+ }
246
+ function assemble(fn, context, strategy, cache, serialize) {
247
+ return strategy.bind(context, fn, cache, serialize);
248
+ }
249
+ function strategyDefault(fn, options) {
250
+ var strategy = fn.length === 1 ? monadic : variadic;
251
+ return assemble(fn, this, strategy, options.cache.create(), options.serializer);
252
+ }
253
+ function strategyVariadic(fn, options) {
254
+ return assemble(fn, this, variadic, options.cache.create(), options.serializer);
255
+ }
256
+ function strategyMonadic(fn, options) {
257
+ return assemble(fn, this, monadic, options.cache.create(), options.serializer);
258
+ }
259
+ var serializerDefault = function() {
260
+ return JSON.stringify(arguments);
261
+ };
262
+ function ObjectWithoutPrototypeCache() {
263
+ this.cache = /* @__PURE__ */ Object.create(null);
264
+ }
265
+ ObjectWithoutPrototypeCache.prototype.get = function(key) {
266
+ return this.cache[key];
267
+ };
268
+ ObjectWithoutPrototypeCache.prototype.set = function(key, value) {
269
+ this.cache[key] = value;
270
+ };
271
+ var cacheDefault = {
272
+ create: function create() {
273
+ return new ObjectWithoutPrototypeCache();
274
+ }
275
+ };
276
+ var strategies = {
277
+ variadic: strategyVariadic,
278
+ monadic: strategyMonadic
279
+ };
280
+
214
281
  // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/utils.js
215
282
  function getMagnitude(x) {
216
283
  return Math.floor(Math.log(x) * Math.LOG10E);
@@ -233,6 +300,56 @@
233
300
  throw new Err(message);
234
301
  }
235
302
  }
303
+ var createMemoizedNumberFormat = memoize(function() {
304
+ var _a;
305
+ var args = [];
306
+ for (var _i = 0; _i < arguments.length; _i++) {
307
+ args[_i] = arguments[_i];
308
+ }
309
+ return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
310
+ }, {
311
+ strategy: strategies.variadic
312
+ });
313
+ var createMemoizedDateTimeFormat = memoize(function() {
314
+ var _a;
315
+ var args = [];
316
+ for (var _i = 0; _i < arguments.length; _i++) {
317
+ args[_i] = arguments[_i];
318
+ }
319
+ return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
320
+ }, {
321
+ strategy: strategies.variadic
322
+ });
323
+ var createMemoizedPluralRules = memoize(function() {
324
+ var _a;
325
+ var args = [];
326
+ for (var _i = 0; _i < arguments.length; _i++) {
327
+ args[_i] = arguments[_i];
328
+ }
329
+ return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();
330
+ }, {
331
+ strategy: strategies.variadic
332
+ });
333
+ var createMemoizedLocale = memoize(function() {
334
+ var _a;
335
+ var args = [];
336
+ for (var _i = 0; _i < arguments.length; _i++) {
337
+ args[_i] = arguments[_i];
338
+ }
339
+ return new ((_a = Intl.Locale).bind.apply(_a, __spreadArray([void 0], args, false)))();
340
+ }, {
341
+ strategy: strategies.variadic
342
+ });
343
+ var createMemoizedListFormat = memoize(function() {
344
+ var _a;
345
+ var args = [];
346
+ for (var _i = 0; _i < arguments.length; _i++) {
347
+ args[_i] = arguments[_i];
348
+ }
349
+ return new ((_a = Intl.ListFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();
350
+ }, {
351
+ strategy: strategies.variadic
352
+ });
236
353
 
237
354
  // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/NumberFormat/ToRawPrecision.js
238
355
  function ToRawPrecision(x, minPrecision, maxPrecision) {