@ducatjs/money 0.1.0 → 0.2.1
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/NOTICE +73 -0
- package/README.md +479 -62
- package/data/cash-rounding.json +123 -2
- package/data/cldr-cash.json +101 -0
- package/data/historic.json +78 -0
- package/data/iso4217-list-three.xml +1185 -0
- package/dist/adyen-fx.d.ts.map +1 -1
- package/dist/adyen-fx.js +22 -4
- package/dist/adyen-fx.js.map +1 -1
- package/dist/boc.d.ts +31 -0
- package/dist/boc.d.ts.map +1 -0
- package/dist/boc.js +114 -0
- package/dist/boc.js.map +1 -0
- package/dist/boe.d.ts +33 -0
- package/dist/boe.d.ts.map +1 -0
- package/dist/boe.js +114 -0
- package/dist/boe.js.map +1 -0
- package/dist/cash.d.ts +30 -1
- package/dist/cash.d.ts.map +1 -1
- package/dist/cash.js +50 -2
- package/dist/cash.js.map +1 -1
- package/dist/convert.d.ts +10 -9
- package/dist/convert.d.ts.map +1 -1
- package/dist/convert.js +13 -3
- package/dist/convert.js.map +1 -1
- package/dist/drizzle/mysql.d.ts +105 -0
- package/dist/drizzle/mysql.d.ts.map +1 -0
- package/dist/drizzle/mysql.js +60 -0
- package/dist/drizzle/mysql.js.map +1 -0
- package/dist/drizzle/pg.d.ts +103 -0
- package/dist/drizzle/pg.d.ts.map +1 -0
- package/dist/drizzle/pg.js +60 -0
- package/dist/drizzle/pg.js.map +1 -0
- package/dist/drizzle/sqlite.d.ts +102 -0
- package/dist/drizzle/sqlite.d.ts.map +1 -0
- package/dist/drizzle/sqlite.js +59 -0
- package/dist/drizzle/sqlite.js.map +1 -0
- package/dist/ecb.d.ts +37 -2
- package/dist/ecb.d.ts.map +1 -1
- package/dist/ecb.js +148 -10
- package/dist/ecb.js.map +1 -1
- package/dist/fed.d.ts +35 -0
- package/dist/fed.d.ts.map +1 -0
- package/dist/fed.js +134 -0
- package/dist/fed.js.map +1 -0
- package/dist/fetch.d.ts +45 -0
- package/dist/fetch.d.ts.map +1 -1
- package/dist/fetch.js +167 -24
- package/dist/fetch.js.map +1 -1
- package/dist/fn.d.ts +8 -1
- package/dist/fn.d.ts.map +1 -1
- package/dist/fn.js +8 -1
- package/dist/fn.js.map +1 -1
- package/dist/generated/cash.d.ts +2 -0
- package/dist/generated/cash.d.ts.map +1 -1
- package/dist/generated/cash.js +101 -0
- package/dist/generated/cash.js.map +1 -1
- package/dist/generated/historic.d.ts +337 -0
- package/dist/generated/historic.d.ts.map +1 -0
- package/dist/generated/historic.js +66 -0
- package/dist/generated/historic.js.map +1 -0
- package/dist/historic.d.ts +40 -0
- package/dist/historic.d.ts.map +1 -0
- package/dist/historic.js +43 -0
- package/dist/historic.js.map +1 -0
- package/dist/history.d.ts +96 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +213 -0
- package/dist/history.js.map +1 -0
- package/dist/hmrc.d.ts +28 -0
- package/dist/hmrc.d.ts.map +1 -0
- package/dist/hmrc.js +108 -0
- package/dist/hmrc.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kysely.d.ts +120 -0
- package/dist/kysely.d.ts.map +1 -0
- package/dist/kysely.js +309 -0
- package/dist/kysely.js.map +1 -0
- package/dist/money.d.ts +93 -9
- package/dist/money.d.ts.map +1 -1
- package/dist/money.js +135 -9
- package/dist/money.js.map +1 -1
- package/dist/parse.d.ts +45 -1
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +290 -3
- package/dist/parse.js.map +1 -1
- package/dist/pg.d.ts +100 -0
- package/dist/pg.d.ts.map +1 -0
- package/dist/pg.js +343 -0
- package/dist/pg.js.map +1 -0
- package/dist/plugins/adyen.d.ts +1 -1
- package/dist/plugins/adyen.d.ts.map +1 -1
- package/dist/plugins/adyen.js.map +1 -1
- package/dist/plugins/all.d.ts +8 -1
- package/dist/plugins/all.d.ts.map +1 -1
- package/dist/plugins/all.js +8 -1
- package/dist/plugins/all.js.map +1 -1
- package/dist/plugins/allocate.d.ts +1 -1
- package/dist/plugins/allocate.d.ts.map +1 -1
- package/dist/plugins/allocate.js.map +1 -1
- package/dist/plugins/braintree.d.ts +1 -1
- package/dist/plugins/braintree.d.ts.map +1 -1
- package/dist/plugins/braintree.js.map +1 -1
- package/dist/plugins/cash.d.ts +1 -1
- package/dist/plugins/cash.d.ts.map +1 -1
- package/dist/plugins/cash.js.map +1 -1
- package/dist/plugins/checkout.d.ts +1 -1
- package/dist/plugins/checkout.d.ts.map +1 -1
- package/dist/plugins/checkout.js.map +1 -1
- package/dist/plugins/convert.d.ts +5 -5
- package/dist/plugins/convert.d.ts.map +1 -1
- package/dist/plugins/convert.js.map +1 -1
- package/dist/plugins/exact.d.ts +1 -1
- package/dist/plugins/exact.d.ts.map +1 -1
- package/dist/plugins/exact.js.map +1 -1
- package/dist/plugins/fixed.d.ts +1 -1
- package/dist/plugins/fixed.d.ts.map +1 -1
- package/dist/plugins/fixed.js.map +1 -1
- package/dist/plugins/format.d.ts +1 -1
- package/dist/plugins/format.d.ts.map +1 -1
- package/dist/plugins/format.js.map +1 -1
- package/dist/plugins/klarna.d.ts +1 -1
- package/dist/plugins/klarna.d.ts.map +1 -1
- package/dist/plugins/klarna.js.map +1 -1
- package/dist/plugins/paypal.d.ts +1 -1
- package/dist/plugins/paypal.d.ts.map +1 -1
- package/dist/plugins/paypal.js +0 -4
- package/dist/plugins/paypal.js.map +1 -1
- package/dist/plugins/prisma.d.ts +1 -1
- package/dist/plugins/prisma.d.ts.map +1 -1
- package/dist/plugins/prisma.js +0 -4
- package/dist/plugins/prisma.js.map +1 -1
- package/dist/plugins/stripe.d.ts +1 -1
- package/dist/plugins/stripe.d.ts.map +1 -1
- package/dist/plugins/stripe.js +0 -4
- package/dist/plugins/stripe.js.map +1 -1
- package/dist/plugins/tax.d.ts +6 -6
- package/dist/plugins/tax.d.ts.map +1 -1
- package/dist/plugins/tax.js.map +1 -1
- package/dist/policy.d.ts +34 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +90 -0
- package/dist/policy.js.map +1 -0
- package/dist/prisma.d.ts +25 -14
- package/dist/prisma.d.ts.map +1 -1
- package/dist/prisma.js +29 -19
- package/dist/prisma.js.map +1 -1
- package/dist/provider.d.ts +21 -7
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +51 -11
- package/dist/provider.js.map +1 -1
- package/dist/rate-text.d.ts +38 -0
- package/dist/rate-text.d.ts.map +1 -0
- package/dist/rate-text.js +143 -0
- package/dist/rate-text.js.map +1 -0
- package/dist/rate.d.ts +61 -5
- package/dist/rate.d.ts.map +1 -1
- package/dist/rate.js +133 -33
- package/dist/rate.js.map +1 -1
- package/dist/rounding.js +1 -1
- package/dist/rounding.js.map +1 -1
- package/dist/schema.d.ts +43 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +77 -0
- package/dist/schema.js.map +1 -0
- package/dist/sql.d.ts +54 -0
- package/dist/sql.d.ts.map +1 -0
- package/dist/sql.js +131 -0
- package/dist/sql.js.map +1 -0
- package/dist/tax.d.ts +13 -9
- package/dist/tax.d.ts.map +1 -1
- package/dist/tax.js +20 -4
- package/dist/tax.js.map +1 -1
- package/dist/testing/arbitraries.d.ts +43 -0
- package/dist/testing/arbitraries.d.ts.map +1 -0
- package/dist/testing/arbitraries.js +98 -0
- package/dist/testing/arbitraries.js.map +1 -0
- package/dist/testing/index.d.ts +67 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +159 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/jest.d.ts +2 -0
- package/dist/testing/jest.d.ts.map +1 -0
- package/dist/testing/jest.js +15 -0
- package/dist/testing/jest.js.map +1 -0
- package/dist/testing/vitest.d.ts +7 -0
- package/dist/testing/vitest.d.ts.map +1 -0
- package/dist/testing/vitest.js +12 -0
- package/dist/testing/vitest.js.map +1 -0
- package/dist/valibot.d.ts +33 -0
- package/dist/valibot.d.ts.map +1 -0
- package/dist/valibot.js +61 -0
- package/dist/valibot.js.map +1 -0
- package/dist/zod.d.ts +36 -0
- package/dist/zod.d.ts.map +1 -0
- package/dist/zod.js +58 -0
- package/dist/zod.js.map +1 -0
- package/package.json +116 -5
- package/src/adyen-fx.ts +25 -4
- package/src/boc.ts +136 -0
- package/src/boe.ts +131 -0
- package/src/cash.ts +70 -2
- package/src/convert.ts +33 -15
- package/src/drizzle/mysql.ts +78 -0
- package/src/drizzle/pg.ts +78 -0
- package/src/drizzle/sqlite.ts +70 -0
- package/src/ecb.ts +179 -13
- package/src/fed.ts +146 -0
- package/src/fetch.ts +207 -28
- package/src/fn.ts +14 -0
- package/src/generated/cash.ts +103 -0
- package/src/generated/historic.ts +67 -0
- package/src/historic.ts +77 -0
- package/src/history.ts +333 -0
- package/src/hmrc.ts +125 -0
- package/src/index.ts +4 -0
- package/src/kysely.ts +588 -0
- package/src/money.ts +210 -12
- package/src/parse.ts +371 -4
- package/src/pg.ts +410 -0
- package/src/plugins/adyen.ts +3 -2
- package/src/plugins/all.ts +10 -0
- package/src/plugins/allocate.ts +3 -2
- package/src/plugins/braintree.ts +3 -2
- package/src/plugins/cash.ts +3 -2
- package/src/plugins/checkout.ts +3 -2
- package/src/plugins/convert.ts +6 -6
- package/src/plugins/exact.ts +3 -2
- package/src/plugins/fixed.ts +3 -2
- package/src/plugins/format.ts +3 -2
- package/src/plugins/klarna.ts +3 -2
- package/src/plugins/paypal.ts +3 -2
- package/src/plugins/prisma.ts +3 -2
- package/src/plugins/stripe.ts +3 -2
- package/src/plugins/tax.ts +11 -11
- package/src/policy.ts +124 -0
- package/src/prisma.ts +91 -10
- package/src/provider.ts +81 -16
- package/src/rate-text.ts +151 -0
- package/src/rate.ts +205 -36
- package/src/rounding.ts +1 -1
- package/src/schema.ts +119 -0
- package/src/sql.ts +178 -0
- package/src/tax.ts +40 -9
- package/src/testing/arbitraries.ts +134 -0
- package/src/testing/index.ts +247 -0
- package/src/testing/jest.ts +18 -0
- package/src/testing/vitest.ts +18 -0
- package/src/valibot.ts +87 -0
- package/src/zod.ts +78 -0
package/dist/fetch.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Network fetchers for published reference rates, using the platform fetch. Opt-in: nothing else in
|
|
2
2
|
// the library imports this module, so core and @ducatjs/money/convert never touch the
|
|
3
3
|
// network. You decide when to call it and how to cache.
|
|
4
|
-
import {
|
|
4
|
+
import { parseBankOfCanadaJson } from './boc.js';
|
|
5
|
+
import { parseEcbSdmxCsv, parseEcbSdmxDecimals, parseEcbXml } from './ecb.js';
|
|
5
6
|
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
6
7
|
/** The ECB's eurofxref files: the latest day, the last 90 days, and the full history since 1999. */
|
|
7
8
|
export const ECB_URLS = {
|
|
@@ -30,50 +31,192 @@ export class FetchRatesError extends Error {
|
|
|
30
31
|
*/
|
|
31
32
|
export async function fetchEcb(options) {
|
|
32
33
|
const url = ECB_URLS[options?.history ?? 'daily'];
|
|
34
|
+
const body = await getText(url, 'application/xml', options);
|
|
35
|
+
return parsedFrom(url, () => parseEcbXml(body));
|
|
36
|
+
}
|
|
37
|
+
/** The caller's signal, a timeout signal, or both combined. */
|
|
38
|
+
function requestSignal(signal, timeout) {
|
|
39
|
+
if (!Number.isFinite(timeout) || timeout < 0) {
|
|
40
|
+
throw new RangeError(`timeout must be a non-negative number of milliseconds, got ${timeout}`);
|
|
41
|
+
}
|
|
42
|
+
const statics = globalThis.AbortSignal;
|
|
43
|
+
if (timeout === 0 || statics?.timeout === undefined) {
|
|
44
|
+
return signal;
|
|
45
|
+
}
|
|
46
|
+
const timeoutSignal = statics.timeout(timeout);
|
|
47
|
+
if (signal === undefined) {
|
|
48
|
+
return timeoutSignal;
|
|
49
|
+
}
|
|
50
|
+
if (statics.any === undefined) {
|
|
51
|
+
// Without AbortSignal.any the caller's signal wins: it is the one they can control.
|
|
52
|
+
return signal;
|
|
53
|
+
}
|
|
54
|
+
return statics.any([signal, timeoutSignal]);
|
|
55
|
+
}
|
|
56
|
+
/** The ECB Data Portal's SDMX REST API (no key, and CORS-enabled, so it works in browsers). */
|
|
57
|
+
export const ECB_DATA_API = 'https://data-api.ecb.europa.eu/service/data/EXR';
|
|
58
|
+
/**
|
|
59
|
+
* A request's UTC day: a 'YYYY-MM-DD' string that is a real calendar day, or a Date (any
|
|
60
|
+
* offset) as its UTC day. Anything else is a RangeError, before any request is made.
|
|
61
|
+
*/
|
|
62
|
+
function requestDay(time, name) {
|
|
63
|
+
let day;
|
|
64
|
+
if (typeof time === 'string') {
|
|
65
|
+
day = time;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
day = Number.isNaN(time.getTime()) ? '' : time.toISOString().slice(0, 10);
|
|
69
|
+
}
|
|
70
|
+
const match = /^(\d{4})-(\d\d)-(\d\d)$/.exec(day);
|
|
71
|
+
const date = match === null ? undefined : new Date(Date.UTC(+match[1], +match[2] - 1, +match[3]));
|
|
72
|
+
// Date.UTC rolls 30 February over into March, so a real day must come back unchanged.
|
|
73
|
+
if (date === undefined || date.toISOString().slice(0, 10) !== day) {
|
|
74
|
+
throw new RangeError(`${name} must be a date, got ${String(time)}`);
|
|
75
|
+
}
|
|
76
|
+
return day;
|
|
77
|
+
}
|
|
78
|
+
/** Wraps a parser's SyntaxError with the URL the bad file came from (an error page, usually). */
|
|
79
|
+
function parsedFrom(url, parse) {
|
|
80
|
+
try {
|
|
81
|
+
return parse();
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if (error instanceof SyntaxError) {
|
|
85
|
+
throw new SyntaxError(`${error.message} (from ${url})`, { cause: error });
|
|
86
|
+
}
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/** GETs `url` as text, with the timeout and signal handling every fetcher here shares. */
|
|
91
|
+
async function getText(url, accept, options) {
|
|
92
|
+
return (await getTextOrNotFound(url, accept, options, false));
|
|
93
|
+
}
|
|
94
|
+
/** getText, or undefined for HTTP 404 when `notFoundIsEmpty` (an API's "no results"). */
|
|
95
|
+
async function getTextOrNotFound(url, accept, options, notFoundIsEmpty) {
|
|
33
96
|
const fetchFunction = options?.fetch ?? globalThis.fetch;
|
|
34
97
|
if (fetchFunction === undefined) {
|
|
35
98
|
throw new TypeError('No fetch available: pass options.fetch');
|
|
36
99
|
}
|
|
37
100
|
const init = {
|
|
38
|
-
headers: { accept
|
|
101
|
+
headers: { accept },
|
|
39
102
|
};
|
|
40
103
|
const signal = requestSignal(options?.signal, options?.timeout ?? DEFAULT_TIMEOUT_MS);
|
|
41
104
|
if (signal !== undefined) {
|
|
42
105
|
init.signal = signal;
|
|
43
106
|
}
|
|
44
107
|
const response = await fetchFunction(url, init);
|
|
108
|
+
if (notFoundIsEmpty && response.status === 404) {
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
45
111
|
if (!response.ok) {
|
|
46
112
|
throw new FetchRatesError(url, response.status);
|
|
47
113
|
}
|
|
48
|
-
|
|
114
|
+
return response.text();
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Fetches a date range of ECB euro reference rates from the ECB Data Portal and parses them with
|
|
118
|
+
* parseEcbSdmxCsv: EUR-based tables, one per TARGET working day, newest first, with the published
|
|
119
|
+
* digits. It makes two requests: the series' DECIMALS (small) and the observations without
|
|
120
|
+
* attributes, which keeps the full history since 1999 to about 15 MB. Give a few days before the
|
|
121
|
+
* first day you need, so that a lookback from it has a table to fall back on. A range with no
|
|
122
|
+
* rates (a weekend, or after the latest day) gives []. Both requests share one timeout and are
|
|
123
|
+
* cancelled together: if one fails, the other is aborted. The ECB states that its rates are for
|
|
124
|
+
* information purposes only.
|
|
125
|
+
*
|
|
126
|
+
* const tables = await fetchEcbRange({ start: '2026-01-01', currencies: ['USD', 'JPY'] });
|
|
127
|
+
* const history = rateHistory(tables); // from @ducatjs/money/convert/history
|
|
128
|
+
*/
|
|
129
|
+
export async function fetchEcbRange(options) {
|
|
130
|
+
const currencies = options.currencies ?? [];
|
|
131
|
+
for (const currency of currencies) {
|
|
132
|
+
if (!/^[A-Z]{3}$/.test(currency)) {
|
|
133
|
+
throw new RangeError(`Not an ISO currency code: ${currency}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const start = requestDay(options.start, 'start');
|
|
137
|
+
if (start < '1999-01-04') {
|
|
138
|
+
throw new RangeError(`The ECB's rates start on 1999-01-04, not ${start}`);
|
|
139
|
+
}
|
|
140
|
+
let query = `?format=csvdata&startPeriod=${start}`;
|
|
141
|
+
if (options.end !== undefined) {
|
|
142
|
+
const end = requestDay(options.end, 'end');
|
|
143
|
+
if (end < start) {
|
|
144
|
+
throw new RangeError(`end ${end} is before start ${start}`);
|
|
145
|
+
}
|
|
146
|
+
query += `&endPeriod=${end}`;
|
|
147
|
+
}
|
|
148
|
+
const url = `${ECB_DATA_API}/D.${currencies.join('+')}.EUR.SP00.A`;
|
|
149
|
+
const seriesUrl = `${url}?format=csvdata&detail=nodata`;
|
|
150
|
+
const dataUrl = `${url}${query}&detail=dataonly`;
|
|
151
|
+
// One controller for both requests, tied to the caller's signal and the timeout, so that a
|
|
152
|
+
// failure of either cancels the other (the data can be ~15 MB) instead of letting it run on.
|
|
153
|
+
let shared = options;
|
|
154
|
+
let controller;
|
|
155
|
+
const Controller = globalThis
|
|
156
|
+
.AbortController;
|
|
157
|
+
if (Controller !== undefined) {
|
|
158
|
+
const own = new Controller();
|
|
159
|
+
controller = own;
|
|
160
|
+
const outer = requestSignal(options.signal, options.timeout ?? DEFAULT_TIMEOUT_MS);
|
|
161
|
+
if (outer?.aborted === true) {
|
|
162
|
+
own.abort(outer.reason);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
outer?.addEventListener('abort', () => own.abort(outer.reason), { once: true });
|
|
166
|
+
}
|
|
167
|
+
shared = { ...options, signal: own.signal, timeout: 0 };
|
|
168
|
+
}
|
|
169
|
+
let series;
|
|
170
|
+
let data;
|
|
49
171
|
try {
|
|
50
|
-
|
|
172
|
+
[series, data] = await Promise.all([
|
|
173
|
+
getText(seriesUrl, 'text/csv', shared),
|
|
174
|
+
getTextOrNotFound(dataUrl, 'text/csv', shared, true),
|
|
175
|
+
]);
|
|
51
176
|
}
|
|
52
177
|
catch (error) {
|
|
53
|
-
|
|
54
|
-
if (error instanceof SyntaxError) {
|
|
55
|
-
throw new SyntaxError(`${error.message} (from ${url})`, { cause: error });
|
|
56
|
-
}
|
|
178
|
+
controller?.abort(error);
|
|
57
179
|
throw error;
|
|
58
180
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
function requestSignal(signal, timeout) {
|
|
62
|
-
if (!Number.isFinite(timeout) || timeout < 0) {
|
|
63
|
-
throw new RangeError(`timeout must be a non-negative number of milliseconds, got ${timeout}`);
|
|
64
|
-
}
|
|
65
|
-
const statics = globalThis.AbortSignal;
|
|
66
|
-
if (timeout === 0 || statics?.timeout === undefined) {
|
|
67
|
-
return signal;
|
|
181
|
+
if (data === undefined) {
|
|
182
|
+
return [];
|
|
68
183
|
}
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
184
|
+
const decimals = parsedFrom(seriesUrl, () => parseEcbSdmxDecimals(series));
|
|
185
|
+
return parsedFrom(dataUrl, () => parseEcbSdmxCsv(data, { decimals }));
|
|
186
|
+
}
|
|
187
|
+
/** The Bank of Canada's Valet API for its daily exchange rates (no key; CORS-enabled). */
|
|
188
|
+
export const BANK_OF_CANADA_URL = 'https://www.bankofcanada.ca/valet/observations/group/FX_RATES_DAILY/json';
|
|
189
|
+
/**
|
|
190
|
+
* Fetches the Bank of Canada's daily exchange rates from its Valet API and parses them with
|
|
191
|
+
* parseBankOfCanadaJson: CAD-based tables, newest first. Without `start`, only the latest day;
|
|
192
|
+
* without `end`, up to the latest. A range with no business days in it gives [].
|
|
193
|
+
* The Bank asks users to keep within its request limits, which it doesn't publish, and its rates
|
|
194
|
+
* are "released for statistical and analytical purposes only", not for transactions.
|
|
195
|
+
*
|
|
196
|
+
* const [latest] = await fetchBankOfCanada();
|
|
197
|
+
* const year = await fetchBankOfCanada({ start: '2026-01-01' });
|
|
198
|
+
*/
|
|
199
|
+
export async function fetchBankOfCanada(options) {
|
|
200
|
+
let query = '?recent=1';
|
|
201
|
+
if (options?.start !== undefined) {
|
|
202
|
+
const start = requestDay(options.start, 'start');
|
|
203
|
+
if (start < '2017-01-03') {
|
|
204
|
+
throw new RangeError(`Valet's daily rates start on 2017-01-03, not ${start}`);
|
|
205
|
+
}
|
|
206
|
+
query = `?start_date=${start}`;
|
|
207
|
+
if (options.end !== undefined) {
|
|
208
|
+
const end = requestDay(options.end, 'end');
|
|
209
|
+
if (end < start) {
|
|
210
|
+
throw new RangeError(`end ${end} is before start ${start}`);
|
|
211
|
+
}
|
|
212
|
+
query += `&end_date=${end}`;
|
|
213
|
+
}
|
|
72
214
|
}
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
return signal;
|
|
215
|
+
else if (options?.end !== undefined) {
|
|
216
|
+
throw new RangeError('end needs a start');
|
|
76
217
|
}
|
|
77
|
-
|
|
218
|
+
const url = `${BANK_OF_CANADA_URL}${query}`;
|
|
219
|
+
const body = await getText(url, 'application/json', options);
|
|
220
|
+
return parsedFrom(url, () => parseBankOfCanadaJson(body));
|
|
78
221
|
}
|
|
79
222
|
//# sourceMappingURL=fetch.js.map
|
package/dist/fetch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,sFAAsF;AACtF,wDAAwD;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,sFAAsF;AACtF,wDAAwD;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO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AAG,KAAK,EAAE,CAAC;gBAChB,MAAM,IAAI,UAAU,CAAC,OAAO,GAAG,oBAAoB,KAAK,EAAE,CAAC,CAAC;YAC9D,CAAC;YACD,KAAK,IAAI,aAAa,GAAG,EAAE,CAAC;QAC9B,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,EAAE,GAAG,KAAK,SAAS,EAAE,CAAC;QACtC,MAAM,IAAI,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAC5C,CAAC;IACD,MAAM,GAAG,GAAG,GAAG,kBAAkB,GAAG,KAAK,EAAE,CAAC;IAC5C,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAC7D,OAAO,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5D,CAAC"}
|
package/dist/fn.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* (`add(price, fee)`, `allocate(total, [1, 1])`), for code that prefers that style or must not
|
|
4
4
|
* install methods on Money (importing it changes no prototype).
|
|
5
5
|
*/
|
|
6
|
-
export { money, fromMinor, zero, fromJSON, isMoney, extendMoney, type ExtendMoneyOptions, sum, ratio, add, subtract, negate, abs, multiply, divide, round, toScale, compare, equals, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual, isZero, isPositive, isNegative, sign, min, max, clamp, toDecimal, toMinor, toMinorNumber, CurrencyMismatchError, type Money, type MoneyJSON, type MoneyOptions, type CurrencyInput, type Factor, type Ratio, } from './money.js';
|
|
6
|
+
export { money, fromMinor, zero, fromJSON, isMoney, isMoneyIn, assertCurrency, extendMoney, type ExtendMoneyOptions, sum, ratio, add, subtract, negate, abs, multiply, divide, round, toScale, compare, equals, identical, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual, isZero, isPositive, isNegative, sign, min, max, clamp, majorPart, minorPart, toDecimal, toMinor, toMinorNumber, CurrencyMismatchError, type RoundingPolicy, type RoundingInput, type Money, type MoneyJSON, type MoneyOptions, type CurrencyInput, type Factor, type Ratio, } from './money.js';
|
|
7
7
|
export { DEFAULT_ROUNDING, Rounding, RoundingError, type RoundingMode } from './rounding.js';
|
|
8
8
|
export { currencyExponent, defineCurrency, isCurrency, ISO_EXPONENTS, ISO_4217_PUBLISHED, ISO_NON_MONETARY, type CurrencyCode, type IsoCurrencyCode, type CustomCurrencies, } from './currency.js';
|
|
9
9
|
export * from './allocate.js';
|
|
@@ -11,9 +11,16 @@ export * from './tax.js';
|
|
|
11
11
|
export * from './convert.js';
|
|
12
12
|
export * from './exact.js';
|
|
13
13
|
export * from './ecb.js';
|
|
14
|
+
export * from './boc.js';
|
|
15
|
+
export * from './boe.js';
|
|
16
|
+
export * from './hmrc.js';
|
|
17
|
+
export * from './fed.js';
|
|
18
|
+
export * from './history.js';
|
|
14
19
|
export * from './stripe-fx.js';
|
|
15
20
|
export * from './adyen-fx.js';
|
|
16
21
|
export * from './cash.js';
|
|
22
|
+
export * from './historic.js';
|
|
23
|
+
export { roundingPolicy, isoPolicy, assertScale, type RoundingPolicyOptions } from './policy.js';
|
|
17
24
|
export * from './format.js';
|
|
18
25
|
export * from './parse.js';
|
|
19
26
|
export * from './stripe.js';
|
package/dist/fn.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fn.d.ts","sourceRoot":"","sources":["../src/fn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EACL,KAAK,EACL,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,WAAW,EACX,KAAK,kBAAkB,EACvB,GAAG,EACH,KAAK,EACL,GAAG,EACH,QAAQ,EACR,MAAM,EACN,GAAG,EACH,QAAQ,EACR,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,QAAQ,EACR,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,MAAM,EACN,UAAU,EACV,UAA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cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
package/dist/fn.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// Everything the root entry exports, plus the core Money methods as plain functions. Each is
|
|
7
7
|
// re-exported straight from its own module, so every name is one re-export away from its definition
|
|
8
8
|
// (under vitest each hop is a getter call, which shows in the CodSpeed benchmarks).
|
|
9
|
-
export { money, fromMinor, zero, fromJSON, isMoney, extendMoney, sum, ratio, add, subtract, negate, abs, multiply, divide, round, toScale, compare, equals, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual, isZero, isPositive, isNegative, sign, min, max, clamp, toDecimal, toMinor, toMinorNumber, CurrencyMismatchError, } from './money.js';
|
|
9
|
+
export { money, fromMinor, zero, fromJSON, isMoney, isMoneyIn, assertCurrency, extendMoney, sum, ratio, add, subtract, negate, abs, multiply, divide, round, toScale, compare, equals, identical, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual, isZero, isPositive, isNegative, sign, min, max, clamp, majorPart, minorPart, toDecimal, toMinor, toMinorNumber, CurrencyMismatchError, } from './money.js';
|
|
10
10
|
export { DEFAULT_ROUNDING, Rounding, RoundingError } from './rounding.js';
|
|
11
11
|
export { currencyExponent, defineCurrency, isCurrency, ISO_EXPONENTS, ISO_4217_PUBLISHED, ISO_NON_MONETARY, } from './currency.js';
|
|
12
12
|
export * from './allocate.js';
|
|
@@ -14,9 +14,16 @@ export * from './tax.js';
|
|
|
14
14
|
export * from './convert.js';
|
|
15
15
|
export * from './exact.js';
|
|
16
16
|
export * from './ecb.js';
|
|
17
|
+
export * from './boc.js';
|
|
18
|
+
export * from './boe.js';
|
|
19
|
+
export * from './hmrc.js';
|
|
20
|
+
export * from './fed.js';
|
|
21
|
+
export * from './history.js';
|
|
17
22
|
export * from './stripe-fx.js';
|
|
18
23
|
export * from './adyen-fx.js';
|
|
19
24
|
export * from './cash.js';
|
|
25
|
+
export * from './historic.js';
|
|
26
|
+
export { roundingPolicy, isoPolicy, assertScale } from './policy.js';
|
|
20
27
|
export * from './format.js';
|
|
21
28
|
export * from './parse.js';
|
|
22
29
|
export * from './stripe.js';
|
package/dist/fn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fn.js","sourceRoot":"","sources":["../src/fn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,6FAA6F;AAC7F,oGAAoG;AACpG,oFAAoF;AACpF,OAAO,EACL,KAAK,EACL,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,WAAW,EAEX,GAAG,EACH,KAAK,EACL,GAAG,EACH,QAAQ,EACR,MAAM,EACN,GAAG,EACH,QAAQ,EACR,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,QAAQ,EACR,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,MAAM,EACN,UAAU,EACV,UAAU,EACV,IAAI,EACJ,GAAG,EACH,GAAG,EACH,KAAK,EACL,SAAS,EACT,OAAO,EACP,aAAa,EACb,qBAAqB,
|
|
1
|
+
{"version":3,"file":"fn.js","sourceRoot":"","sources":["../src/fn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,6FAA6F;AAC7F,oGAAoG;AACpG,oFAAoF;AACpF,OAAO,EACL,KAAK,EACL,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,SAAS,EACT,cAAc,EACd,WAAW,EAEX,GAAG,EACH,KAAK,EACL,GAAG,EACH,QAAQ,EACR,MAAM,EACN,GAAG,EACH,QAAQ,EACR,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,SAAS,EACT,QAAQ,EACR,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,MAAM,EACN,UAAU,EACV,UAAU,EACV,IAAI,EACJ,GAAG,EACH,GAAG,EACH,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,OAAO,EACP,aAAa,EACb,qBAAqB,GAStB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,aAAa,EAAqB,MAAM,eAAe,CAAC;AAC7F,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,gBAAgB,GAIjB,MAAM,eAAe,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAA8B,MAAM,aAAa,CAAC;AACjG,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
package/dist/generated/cash.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export interface CashRule {
|
|
|
7
7
|
/** false: only secondary sources were found. */
|
|
8
8
|
readonly verified: boolean;
|
|
9
9
|
readonly source: string;
|
|
10
|
+
/** The tie rule the source prescribes, where it isn't halfExpand. */
|
|
11
|
+
readonly rounding?: import('../rounding.js').RoundingMode;
|
|
10
12
|
}
|
|
11
13
|
export declare const CASH_RULES: readonly CashRule[];
|
|
12
14
|
//# sourceMappingURL=cash.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cash.d.ts","sourceRoot":"","sources":["../../src/generated/cash.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,8CAA8C;IAC9C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"cash.d.ts","sourceRoot":"","sources":["../../src/generated/cash.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,8CAA8C;IAC9C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,gBAAgB,EAAE,YAAY,CAAC;CAC3D;AAED,eAAO,MAAM,UAAU,EAAE,SAAS,QAAQ,EA6czC,CAAC"}
|
package/dist/generated/cash.js
CHANGED
|
@@ -359,6 +359,107 @@ export const CASH_RULES = [
|
|
|
359
359
|
"scope": "cash (permitted, not required; varies by state)",
|
|
360
360
|
"verified": false,
|
|
361
361
|
"source": "https://en.wikipedia.org/wiki/Cash_rounding"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"currency": "AMD",
|
|
365
|
+
"increment": 1000,
|
|
366
|
+
"countries": [
|
|
367
|
+
"AM"
|
|
368
|
+
],
|
|
369
|
+
"scope": "cash (practice)",
|
|
370
|
+
"verified": true,
|
|
371
|
+
"source": "https://old.cba.am/en/SitePages/nccracoinscirculated.aspx"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"currency": "CRC",
|
|
375
|
+
"increment": 1000,
|
|
376
|
+
"countries": [
|
|
377
|
+
"CR"
|
|
378
|
+
],
|
|
379
|
+
"scope": "cash (practice)",
|
|
380
|
+
"verified": true,
|
|
381
|
+
"source": "https://www.bccr.fi.cr/cr/es/noticias/listado-de-noticias/2026/monedas-de-5-10-y-25-del-diseno-anterior-dejaran-de-funcionar-como-medio-de-pago-el-1-de-julio-del-2.html"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"currency": "GYD",
|
|
385
|
+
"increment": 100,
|
|
386
|
+
"countries": [
|
|
387
|
+
"GY"
|
|
388
|
+
],
|
|
389
|
+
"scope": "cash",
|
|
390
|
+
"verified": false,
|
|
391
|
+
"source": "https://bankofguyana.org.gy/bog/images/communications/press_release/Notice%20to%20stop%20minting%20one%20dollar%20coin.pdf"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"currency": "MNT",
|
|
395
|
+
"increment": 100,
|
|
396
|
+
"countries": [
|
|
397
|
+
"MN"
|
|
398
|
+
],
|
|
399
|
+
"scope": "cash",
|
|
400
|
+
"verified": true,
|
|
401
|
+
"source": "https://www.mongolbank.mn/en/p/1416"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"currency": "MRU",
|
|
405
|
+
"increment": 20,
|
|
406
|
+
"countries": [
|
|
407
|
+
"MR"
|
|
408
|
+
],
|
|
409
|
+
"scope": "cash",
|
|
410
|
+
"verified": false,
|
|
411
|
+
"source": "https://cridem.org/media/documents/bcm-presentation-gr-2017.pdf"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"currency": "PKR",
|
|
415
|
+
"increment": 100,
|
|
416
|
+
"countries": [
|
|
417
|
+
"PK"
|
|
418
|
+
],
|
|
419
|
+
"scope": "cash",
|
|
420
|
+
"verified": true,
|
|
421
|
+
"source": "https://www.sbp.org.pk/press/2014/Coins-15-Sep-2014.pdf"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"currency": "RSD",
|
|
425
|
+
"increment": 100,
|
|
426
|
+
"countries": [
|
|
427
|
+
"RS"
|
|
428
|
+
],
|
|
429
|
+
"scope": "cash (statutory)",
|
|
430
|
+
"verified": true,
|
|
431
|
+
"source": "https://www.nbs.rs/export/sites/NBS_site/documents/propisi/propisi-trz/opticaj_povlacenje_50_para.pdf",
|
|
432
|
+
"rounding": "halfTrunc"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"currency": "TZS",
|
|
436
|
+
"increment": 5000,
|
|
437
|
+
"countries": [
|
|
438
|
+
"TZ"
|
|
439
|
+
],
|
|
440
|
+
"scope": "cash (practice)",
|
|
441
|
+
"verified": false,
|
|
442
|
+
"source": "https://www.bot.go.tz/Publications/Regular/Quarterly%20statistical%20Bulletin/en/2025090409030924.pdf"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"currency": "TWD",
|
|
446
|
+
"increment": 100,
|
|
447
|
+
"countries": [
|
|
448
|
+
"TW"
|
|
449
|
+
],
|
|
450
|
+
"scope": "cash (practice)",
|
|
451
|
+
"verified": true,
|
|
452
|
+
"source": "https://www.cbc.gov.tw/tw/cp-769-26060-37841-1.html"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"currency": "UZS",
|
|
456
|
+
"increment": 5000,
|
|
457
|
+
"countries": [
|
|
458
|
+
"UZ"
|
|
459
|
+
],
|
|
460
|
+
"scope": "cash (practice)",
|
|
461
|
+
"verified": true,
|
|
462
|
+
"source": "https://cbu.uz/en/banknotes-coins/coins/"
|
|
362
463
|
}
|
|
363
464
|
];
|
|
364
465
|
//# sourceMappingURL=cash.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cash.js","sourceRoot":"","sources":["../../src/generated/cash.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,oBAAoB;
|
|
1
|
+
{"version":3,"file":"cash.js","sourceRoot":"","sources":["../../src/generated/cash.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,oBAAoB;AAepB,MAAM,CAAC,MAAM,UAAU,GAAwB;IAC7C;QACE,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE;YACX,IAAI;YACJ,IAAI;SACL;QACD,OAAO,EAAE,0CAA0C;QACnD,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,yDAAyD;KACpE;IACD;QACE,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,GAAG;QAChB,WAAW,EAAE;YACX,IAAI;SACL;QACD,OAAO,EAAE,WAAW;QACpB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,kHAAkH;KAC7H;IACD;QACE,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,EAAE;QACf,WAAW,EAAE;YACX,IAAI;YACJ,IAAI;YACJ,IAAI;SACL;QACD,OAAO,EAAE,WAAW;QACpB,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,0BAA0B;KACrC;IACD;QACE,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,GAAG;QAChB,WAAW,EAAE;YACX,IAAI;YACJ,IAAI;YACJ,IAAI;SACL;QACD,OAAO,EAAE,WAAW;QACpB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,kIAAkI;KAC7I;IACD;QACE,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE;YACX,IAAI;SACL;QACD,OAAO,EAAE,WAAW;QACpB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,4GAA4G;KACvH;IACD;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