@adriangalilea/utils 2.25.1 → 2.27.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/README.md +17 -12
- package/dist/bot/text.d.ts +23 -0
- package/dist/bot/text.d.ts.map +1 -0
- package/dist/bot/text.js +40 -0
- package/dist/bot/text.js.map +1 -0
- package/dist/bot/update-identity.d.ts +19 -0
- package/dist/bot/update-identity.d.ts.map +1 -0
- package/dist/bot/update-identity.js +92 -0
- package/dist/bot/update-identity.js.map +1 -0
- package/dist/bot/worker.d.ts +62 -0
- package/dist/bot/worker.d.ts.map +1 -1
- package/dist/bot/worker.js +181 -0
- package/dist/bot/worker.js.map +1 -1
- package/dist/universal/currency/classify.d.ts +7 -0
- package/dist/universal/currency/classify.d.ts.map +1 -0
- package/dist/universal/currency/classify.js +147 -0
- package/dist/universal/currency/classify.js.map +1 -0
- package/dist/universal/currency/decimals.d.ts +2 -0
- package/dist/universal/currency/decimals.d.ts.map +1 -0
- package/dist/universal/currency/decimals.js +93 -0
- package/dist/universal/currency/decimals.js.map +1 -0
- package/dist/universal/currency/index.d.ts +12 -57
- package/dist/universal/currency/index.d.ts.map +1 -1
- package/dist/universal/currency/index.js +27 -317
- package/dist/universal/currency/index.js.map +1 -1
- package/dist/universal/currency/money.d.ts +12 -0
- package/dist/universal/currency/money.d.ts.map +1 -0
- package/dist/universal/currency/money.js +40 -0
- package/dist/universal/currency/money.js.map +1 -0
- package/dist/universal/currency/percent.d.ts +7 -0
- package/dist/universal/currency/percent.d.ts.map +1 -0
- package/dist/universal/currency/percent.js +32 -0
- package/dist/universal/currency/percent.js.map +1 -0
- package/dist/universal/currency/symbols.d.ts +32 -0
- package/dist/universal/currency/symbols.d.ts.map +1 -0
- package/dist/universal/currency/symbols.js +36 -0
- package/dist/universal/currency/symbols.js.map +1 -0
- package/dist/universal/currency/usd.d.ts +23 -0
- package/dist/universal/currency/usd.d.ts.map +1 -0
- package/dist/universal/currency/usd.js +54 -0
- package/dist/universal/currency/usd.js.map +1 -0
- package/dist/universal/format.d.ts +17 -29
- package/dist/universal/format.d.ts.map +1 -1
- package/dist/universal/format.js +28 -54
- package/dist/universal/format.js.map +1 -1
- package/package.json +11 -1
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pure number formatting. No currency coupling — money formatting (usd, btc,
|
|
3
3
|
* money(value, code), …) lives in ./currency, which owns the symbol/decimals
|
|
4
|
-
* knowledge
|
|
5
|
-
*
|
|
4
|
+
* knowledge; its module split keeps the crypto-symbol dataset out of bundles
|
|
5
|
+
* that only print money.
|
|
6
|
+
*
|
|
7
|
+
* Every formatter accepts `null | undefined` and renders "—" (em dash) — the
|
|
8
|
+
* universal "no data" glyph. Callers pass DB fields and API values straight
|
|
9
|
+
* through instead of each app re-wrapping every formatter for null.
|
|
6
10
|
*
|
|
7
11
|
* Every Intl call pins "en" — never the runtime default locale. In an SSR app
|
|
8
12
|
* the server formats in en-US and the browser in the user's locale; a
|
|
@@ -12,8 +16,11 @@
|
|
|
12
16
|
* Named exports only (no namespace object): a namespace keeps every function
|
|
13
17
|
* — and its imports — alive in the bundle; named imports tree-shake.
|
|
14
18
|
*/
|
|
19
|
+
export type Numberish = number | null | undefined;
|
|
20
|
+
/** The "no data" glyph every formatter renders for null/undefined. */
|
|
21
|
+
export declare const NO_DATA = "\u2014";
|
|
15
22
|
/** Compact notation: 1.2K, 3.4M, … (Intl, en). */
|
|
16
|
-
export declare function compact(value:
|
|
23
|
+
export declare function compact(value: Numberish): string;
|
|
17
24
|
export interface PercentageOptions {
|
|
18
25
|
/** Fixed decimal places. Omit for smart decimals (2 below 0.1, 0 at ≥100, else 1). */
|
|
19
26
|
decimals?: number;
|
|
@@ -21,20 +28,22 @@ export interface PercentageOptions {
|
|
|
21
28
|
sign?: boolean;
|
|
22
29
|
}
|
|
23
30
|
/** Percentage: smart decimals by default, or fixed via opts; optional +sign. */
|
|
24
|
-
export declare function percentage(value:
|
|
25
|
-
/**
|
|
26
|
-
export declare function
|
|
31
|
+
export declare function percentage(value: Numberish, opts?: PercentageOptions): string;
|
|
32
|
+
/** Plain fixed-decimal number, no grouping: 1.23 (lag, ratios, small counts). */
|
|
33
|
+
export declare function fixed(value: Numberish, decimals?: number): string;
|
|
34
|
+
/** Thousands separators: 1,234,567.89 (optionally fixed decimals). bigint-safe. */
|
|
35
|
+
export declare function withCommas(value: number | bigint | null | undefined, decimals?: number): string;
|
|
27
36
|
/**
|
|
28
37
|
* Bytes → "12.7 TB", "2.0 TB", "850.0 GB", "500.0 MB". Decimal SI prefixes —
|
|
29
38
|
* how drive manufacturers and SMART tools quote capacities (`df -h` too).
|
|
30
39
|
* Below 1 MB the raw byte count is the honest answer.
|
|
31
40
|
*/
|
|
32
|
-
export declare function bytes(value:
|
|
41
|
+
export declare function bytes(value: Numberish): string;
|
|
33
42
|
/**
|
|
34
43
|
* Bits/sec → "10 Gbps", "2.5 Gbps", "100 Mbps". Network speeds use decimal SI
|
|
35
44
|
* (a "1 Gbps" link moves 10^9 bits/sec, not 2^30).
|
|
36
45
|
*/
|
|
37
|
-
export declare function bitsPerSec(value:
|
|
46
|
+
export declare function bitsPerSec(value: Numberish): string;
|
|
38
47
|
/**
|
|
39
48
|
* Decimals that keep 2 significant digits of a sub-cent value, capped at 10.
|
|
40
49
|
* The fix for fixed-decimal erasure: a micro-priced asset (~$4.3e-7) under a
|
|
@@ -42,25 +51,4 @@ export declare function bitsPerSec(value: number): string;
|
|
|
42
51
|
* 4.3e-7 → 8 decimals → "$0.00000043".
|
|
43
52
|
*/
|
|
44
53
|
export declare function sigDecimals(absValue: number): number;
|
|
45
|
-
/** The USD decimals policy: 2 for dollars, more as the value shrinks, significant-digit floor below a cent. */
|
|
46
|
-
export declare function usdDecimals(value: number): number;
|
|
47
|
-
export interface UsdOptions {
|
|
48
|
-
/** Fixed decimal places, overriding the optimal-decimals policy. */
|
|
49
|
-
decimals?: number;
|
|
50
|
-
/** Compact notation for market-cap-scale money: $60.9M. */
|
|
51
|
-
compact?: boolean;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* The USD decimals POLICY as Intl.NumberFormatOptions, for consumers that
|
|
55
|
-
* format internally — animated numbers (NumberFlow), chart axes, table cell
|
|
56
|
-
* renderers. One policy serves strings and widgets alike; `usd()` below is
|
|
57
|
-
* just this policy applied. Value-dependent: recompute when the value moves.
|
|
58
|
-
*/
|
|
59
|
-
export declare function usdIntlOptions(value: number, opts?: UsdOptions): Intl.NumberFormatOptions;
|
|
60
|
-
/**
|
|
61
|
-
* $1,234.56 with optimal decimals (grouped, en-pinned — SSR-hydration-safe);
|
|
62
|
-
* sub-cent values keep 2 significant digits ($0.00000043) instead of rounding
|
|
63
|
-
* to $0.000000. `{compact: true}` → $60.9M; `{decimals}` overrides the policy.
|
|
64
|
-
*/
|
|
65
|
-
export declare function usd(value: number, opts?: UsdOptions): string;
|
|
66
54
|
//# sourceMappingURL=format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/universal/format.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/universal/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAElD,sEAAsE;AACtE,eAAO,MAAM,OAAO,WAAM,CAAC;AAE3B,kDAAkD;AAClD,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAMhD;AAED,MAAM,WAAW,iBAAiB;IACjC,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAED,gFAAgF;AAChF,wBAAgB,UAAU,CACzB,KAAK,EAAE,SAAS,EAChB,IAAI,GAAE,iBAAsB,GAC1B,MAAM,CAaR;AAED,iFAAiF;AACjF,wBAAgB,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,SAAI,GAAG,MAAM,CAG5D;AAED,mFAAmF;AACnF,wBAAgB,UAAU,CACzB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EACzC,QAAQ,CAAC,EAAE,MAAM,GACf,MAAM,CASR;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAO9C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAKnD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
package/dist/universal/format.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pure number formatting. No currency coupling — money formatting (usd, btc,
|
|
3
3
|
* money(value, code), …) lives in ./currency, which owns the symbol/decimals
|
|
4
|
-
* knowledge
|
|
5
|
-
*
|
|
4
|
+
* knowledge; its module split keeps the crypto-symbol dataset out of bundles
|
|
5
|
+
* that only print money.
|
|
6
|
+
*
|
|
7
|
+
* Every formatter accepts `null | undefined` and renders "—" (em dash) — the
|
|
8
|
+
* universal "no data" glyph. Callers pass DB fields and API values straight
|
|
9
|
+
* through instead of each app re-wrapping every formatter for null.
|
|
6
10
|
*
|
|
7
11
|
* Every Intl call pins "en" — never the runtime default locale. In an SSR app
|
|
8
12
|
* the server formats in en-US and the browser in the user's locale; a
|
|
@@ -12,8 +16,12 @@
|
|
|
12
16
|
* Named exports only (no namespace object): a namespace keeps every function
|
|
13
17
|
* — and its imports — alive in the bundle; named imports tree-shake.
|
|
14
18
|
*/
|
|
19
|
+
/** The "no data" glyph every formatter renders for null/undefined. */
|
|
20
|
+
export const NO_DATA = "—";
|
|
15
21
|
/** Compact notation: 1.2K, 3.4M, … (Intl, en). */
|
|
16
22
|
export function compact(value) {
|
|
23
|
+
if (value == null)
|
|
24
|
+
return NO_DATA;
|
|
17
25
|
return new Intl.NumberFormat("en", {
|
|
18
26
|
notation: "compact",
|
|
19
27
|
maximumFractionDigits: 1,
|
|
@@ -21,6 +29,8 @@ export function compact(value) {
|
|
|
21
29
|
}
|
|
22
30
|
/** Percentage: smart decimals by default, or fixed via opts; optional +sign. */
|
|
23
31
|
export function percentage(value, opts = {}) {
|
|
32
|
+
if (value == null)
|
|
33
|
+
return NO_DATA;
|
|
24
34
|
let decimals = opts.decimals;
|
|
25
35
|
if (decimals === undefined) {
|
|
26
36
|
decimals = 1;
|
|
@@ -34,9 +44,19 @@ export function percentage(value, opts = {}) {
|
|
|
34
44
|
const sign = opts.sign && value > 0 ? "+" : "";
|
|
35
45
|
return `${sign}${value.toFixed(decimals)}%`;
|
|
36
46
|
}
|
|
37
|
-
/**
|
|
47
|
+
/** Plain fixed-decimal number, no grouping: 1.23 (lag, ratios, small counts). */
|
|
48
|
+
export function fixed(value, decimals = 2) {
|
|
49
|
+
if (value == null)
|
|
50
|
+
return NO_DATA;
|
|
51
|
+
return value.toFixed(decimals);
|
|
52
|
+
}
|
|
53
|
+
/** Thousands separators: 1,234,567.89 (optionally fixed decimals). bigint-safe. */
|
|
38
54
|
export function withCommas(value, decimals) {
|
|
39
|
-
|
|
55
|
+
if (value == null)
|
|
56
|
+
return NO_DATA;
|
|
57
|
+
const fixed = decimals !== undefined && typeof value === "number"
|
|
58
|
+
? value.toFixed(decimals)
|
|
59
|
+
: value.toString();
|
|
40
60
|
const parts = fixed.split(".");
|
|
41
61
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
42
62
|
return parts.join(".");
|
|
@@ -47,6 +67,8 @@ export function withCommas(value, decimals) {
|
|
|
47
67
|
* Below 1 MB the raw byte count is the honest answer.
|
|
48
68
|
*/
|
|
49
69
|
export function bytes(value) {
|
|
70
|
+
if (value == null)
|
|
71
|
+
return NO_DATA;
|
|
50
72
|
if (value < 1e6)
|
|
51
73
|
return `${value} B`;
|
|
52
74
|
if (value < 1e9)
|
|
@@ -62,18 +84,14 @@ export function bytes(value) {
|
|
|
62
84
|
* (a "1 Gbps" link moves 10^9 bits/sec, not 2^30).
|
|
63
85
|
*/
|
|
64
86
|
export function bitsPerSec(value) {
|
|
87
|
+
if (value == null)
|
|
88
|
+
return NO_DATA;
|
|
65
89
|
if (value < 1e6)
|
|
66
90
|
return `${value} bps`;
|
|
67
91
|
if (value < 1e9)
|
|
68
92
|
return `${(value / 1e6).toFixed(0)} Mbps`;
|
|
69
93
|
return `${(value / 1e9).toFixed(1).replace(/\.0$/, "")} Gbps`;
|
|
70
94
|
}
|
|
71
|
-
// ── USD ────────────────────────────────────────────────────────────
|
|
72
|
-
// USD lives HERE, not in ./currency, deliberately: formatting dollars needs
|
|
73
|
-
// no symbol lookup and no crypto dataset — putting it in currency would drag
|
|
74
|
-
// 133KB of ticker symbols into every client bundle that prints a price.
|
|
75
|
-
// currency.getOptimalDecimals delegates its USD/stables case to usdDecimals,
|
|
76
|
-
// so the policy has exactly one home.
|
|
77
95
|
/**
|
|
78
96
|
* Decimals that keep 2 significant digits of a sub-cent value, capped at 10.
|
|
79
97
|
* The fix for fixed-decimal erasure: a micro-priced asset (~$4.3e-7) under a
|
|
@@ -83,48 +101,4 @@ export function bitsPerSec(value) {
|
|
|
83
101
|
export function sigDecimals(absValue) {
|
|
84
102
|
return Math.min(10, 1 - Math.floor(Math.log10(absValue)));
|
|
85
103
|
}
|
|
86
|
-
/** The USD decimals policy: 2 for dollars, more as the value shrinks, significant-digit floor below a cent. */
|
|
87
|
-
export function usdDecimals(value) {
|
|
88
|
-
if (value === 0)
|
|
89
|
-
return 2;
|
|
90
|
-
const absValue = Math.abs(value);
|
|
91
|
-
if (absValue < 0.01)
|
|
92
|
-
return sigDecimals(absValue);
|
|
93
|
-
if (absValue < 0.1)
|
|
94
|
-
return 4;
|
|
95
|
-
if (absValue < 1)
|
|
96
|
-
return 3;
|
|
97
|
-
return 2;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* The USD decimals POLICY as Intl.NumberFormatOptions, for consumers that
|
|
101
|
-
* format internally — animated numbers (NumberFlow), chart axes, table cell
|
|
102
|
-
* renderers. One policy serves strings and widgets alike; `usd()` below is
|
|
103
|
-
* just this policy applied. Value-dependent: recompute when the value moves.
|
|
104
|
-
*/
|
|
105
|
-
export function usdIntlOptions(value, opts = {}) {
|
|
106
|
-
if (opts.compact) {
|
|
107
|
-
return {
|
|
108
|
-
style: "currency",
|
|
109
|
-
currency: "USD",
|
|
110
|
-
notation: "compact",
|
|
111
|
-
maximumFractionDigits: 1,
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
const decimals = opts.decimals ?? usdDecimals(value);
|
|
115
|
-
return {
|
|
116
|
-
style: "currency",
|
|
117
|
-
currency: "USD",
|
|
118
|
-
minimumFractionDigits: decimals,
|
|
119
|
-
maximumFractionDigits: decimals,
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* $1,234.56 with optimal decimals (grouped, en-pinned — SSR-hydration-safe);
|
|
124
|
-
* sub-cent values keep 2 significant digits ($0.00000043) instead of rounding
|
|
125
|
-
* to $0.000000. `{compact: true}` → $60.9M; `{decimals}` overrides the policy.
|
|
126
|
-
*/
|
|
127
|
-
export function usd(value, opts = {}) {
|
|
128
|
-
return new Intl.NumberFormat("en-US", usdIntlOptions(value, opts)).format(value);
|
|
129
|
-
}
|
|
130
104
|
//# sourceMappingURL=format.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/universal/format.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/universal/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,sEAAsE;AACtE,MAAM,CAAC,MAAM,OAA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AAO,OAAO,CAAC;IAClC,IAAI,KAAK,GAAG,GAAG;QAAE,OAAO,GAAG,KAAK,MAAM,CAAC;IACvC,IAAI,KAAK,GAAG,GAAG;QAAE,OAAO,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAC3D,OAAO,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC;AAC/D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adriangalilea/utils",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.27.0",
|
|
4
4
|
"description": "TypeScript utilities - logger, currency, formatter, GramIO bot plugins, and more",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -179,6 +179,14 @@
|
|
|
179
179
|
"./bot/metrics": {
|
|
180
180
|
"types": "./dist/bot/metrics.d.ts",
|
|
181
181
|
"default": "./dist/bot/metrics.js"
|
|
182
|
+
},
|
|
183
|
+
"./bot/text": {
|
|
184
|
+
"types": "./dist/bot/text.d.ts",
|
|
185
|
+
"default": "./dist/bot/text.js"
|
|
186
|
+
},
|
|
187
|
+
"./bot/update-identity": {
|
|
188
|
+
"types": "./dist/bot/update-identity.d.ts",
|
|
189
|
+
"default": "./dist/bot/update-identity.js"
|
|
182
190
|
}
|
|
183
191
|
},
|
|
184
192
|
"files": [
|
|
@@ -211,6 +219,8 @@
|
|
|
211
219
|
"test:llm": "tsx tests/llm-live-test.ts",
|
|
212
220
|
"test:tg-md": "tsx tests/tg-md-test.ts",
|
|
213
221
|
"test:self-echo": "tsx tests/self-echo-test.ts",
|
|
222
|
+
"test:update-identity": "tsx tests/update-identity-test.ts",
|
|
223
|
+
"test:bot-text": "tsx tests/bot-text-test.ts",
|
|
214
224
|
"test:url": "tsx tests/url-test.ts",
|
|
215
225
|
"test:bot-urls": "tsx tests/bot-urls-test.ts",
|
|
216
226
|
"test:bot-updates": "tsx tests/bot-updates-test.ts",
|