@naturalcycles/js-lib 15.79.1 → 15.81.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.
@@ -16,11 +16,13 @@ declare class MemoizedIntl {
16
16
  getTimezone(): IANATimezone;
17
17
  DateTimeFormat(locales: Intl.LocalesArgument, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
18
18
  RelativeTimeFormat(locales: Intl.LocalesArgument, options: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat;
19
+ DurationFormat(locales: Intl.LocalesArgument, options: Intl.DurationFormatOptions): Intl.DurationFormat;
19
20
  NumberFormat(locales: Intl.LocalesArgument, options: Intl.NumberFormatOptions): Intl.NumberFormat;
20
21
  Collator(locales: Intl.LocalesArgument, options: Intl.CollatorOptions): Intl.Collator;
21
22
  PluralRules(locales: Intl.LocalesArgument, options: Intl.PluralRulesOptions): Intl.PluralRules;
22
23
  ListFormat(locales: Intl.LocalesArgument, options: Intl.ListFormatOptions): Intl.ListFormat;
23
24
  DisplayNames(locales: Intl.LocalesArgument, options: Intl.DisplayNamesOptions): Intl.DisplayNames;
25
+ Segmenter(locales: Intl.LocalesArgument, options: Intl.SegmenterOptions): Intl.Segmenter;
24
26
  }
25
27
  export declare const Intl2: MemoizedIntl;
26
28
  export {};
package/dist/intl/intl.js CHANGED
@@ -24,6 +24,9 @@ class MemoizedIntl {
24
24
  RelativeTimeFormat(locales, options) {
25
25
  return new Intl.RelativeTimeFormat(locales, options);
26
26
  }
27
+ DurationFormat(locales, options) {
28
+ return new Intl.DurationFormat(locales, options);
29
+ }
27
30
  NumberFormat(locales, options) {
28
31
  return new Intl.NumberFormat(locales, options);
29
32
  }
@@ -39,6 +42,9 @@ class MemoizedIntl {
39
42
  DisplayNames(locales, options) {
40
43
  return new Intl.DisplayNames(locales, options);
41
44
  }
45
+ Segmenter(locales, options) {
46
+ return new Intl.Segmenter(locales, options);
47
+ }
42
48
  }
43
49
  __decorate([
44
50
  _Memo()
@@ -49,6 +55,9 @@ __decorate([
49
55
  __decorate([
50
56
  _Memo()
51
57
  ], MemoizedIntl.prototype, "RelativeTimeFormat", null);
58
+ __decorate([
59
+ _Memo()
60
+ ], MemoizedIntl.prototype, "DurationFormat", null);
52
61
  __decorate([
53
62
  _Memo()
54
63
  ], MemoizedIntl.prototype, "NumberFormat", null);
@@ -64,4 +73,7 @@ __decorate([
64
73
  __decorate([
65
74
  _Memo()
66
75
  ], MemoizedIntl.prototype, "DisplayNames", null);
76
+ __decorate([
77
+ _Memo()
78
+ ], MemoizedIntl.prototype, "Segmenter", null);
67
79
  export const Intl2 = new MemoizedIntl();
package/dist/types.d.ts CHANGED
@@ -234,6 +234,7 @@ export type NumberOfMilliseconds = number;
234
234
  * Integer between 0 and 100 (inclusive).
235
235
  */
236
236
  export type NumberOfPercent = number;
237
+ export type NumberOfBytes = number;
237
238
  /**
238
239
  * Same as `number`, but with semantic meaning that it's an Integer.
239
240
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/js-lib",
3
3
  "type": "module",
4
- "version": "15.79.1",
4
+ "version": "15.81.0",
5
5
  "dependencies": {
6
6
  "tslib": "^2"
7
7
  },
@@ -17,10 +17,10 @@
17
17
  "@types/crypto-js": "^4",
18
18
  "@types/node": "^26",
19
19
  "@types/semver": "^7",
20
+ "typescript": "rc",
20
21
  "crypto-js": "^4",
21
22
  "dayjs": "^1",
22
- "typescript": "rc",
23
- "@naturalcycles/dev-lib": "18.4.2"
23
+ "@naturalcycles/dev-lib": "0.0.0"
24
24
  },
25
25
  "exports": {
26
26
  ".": "./dist/index.js",
package/src/intl/intl.ts CHANGED
@@ -38,6 +38,14 @@ class MemoizedIntl {
38
38
  return new Intl.RelativeTimeFormat(locales, options)
39
39
  }
40
40
 
41
+ @_Memo()
42
+ DurationFormat(
43
+ locales: Intl.LocalesArgument,
44
+ options: Intl.DurationFormatOptions,
45
+ ): Intl.DurationFormat {
46
+ return new Intl.DurationFormat(locales, options)
47
+ }
48
+
41
49
  @_Memo()
42
50
  NumberFormat(
43
51
  locales: Intl.LocalesArgument,
@@ -68,6 +76,11 @@ class MemoizedIntl {
68
76
  ): Intl.DisplayNames {
69
77
  return new Intl.DisplayNames(locales, options)
70
78
  }
79
+
80
+ @_Memo()
81
+ Segmenter(locales: Intl.LocalesArgument, options: Intl.SegmenterOptions): Intl.Segmenter {
82
+ return new Intl.Segmenter(locales, options)
83
+ }
71
84
  }
72
85
 
73
86
  export const Intl2 = new MemoizedIntl()
@@ -53,7 +53,7 @@ export function _deepEquals<T>(a: T, b: T): boolean {
53
53
  if (Array.isArray(a)) {
54
54
  const length = a.length
55
55
  if (!Array.isArray(b) || length !== b.length) return false
56
- for (let i = length; i-- !== 0; ) {
56
+ for (let i = length; i-- !== 0;) {
57
57
  if (!_deepEquals(a[i], b[i])) return false
58
58
  }
59
59
  return true
@@ -134,7 +134,7 @@ export function _deepJsonEquals<T>(a: T, b: T): boolean {
134
134
  if (Array.isArray(a)) {
135
135
  const length = a.length
136
136
  if (!Array.isArray(b) || length !== b.length) return false
137
- for (let i = length; i-- !== 0; ) {
137
+ for (let i = length; i-- !== 0;) {
138
138
  if (!_deepJsonEquals(a[i], b[i])) return false
139
139
  }
140
140
  return true
package/src/types.ts CHANGED
@@ -297,6 +297,8 @@ export type NumberOfMilliseconds = number
297
297
  */
298
298
  export type NumberOfPercent = number
299
299
 
300
+ export type NumberOfBytes = number
301
+
300
302
  /**
301
303
  * Same as `number`, but with semantic meaning that it's an Integer.
302
304
  */