@amboras-dev/money 0.1.0 → 0.2.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.
Files changed (76) hide show
  1. package/README.md +14 -6
  2. package/dist/ai.cjs +4 -4
  3. package/dist/ai.d.cts +1 -1
  4. package/dist/ai.d.ts +1 -1
  5. package/dist/ai.js +4 -4
  6. package/dist/{allocate-D7tm_t_o.cjs → allocate-CZRg4TOP.cjs} +2 -2
  7. package/dist/{allocate-CdnhvAda.js → allocate-X7_jAtOj.js} +2 -2
  8. package/dist/{amount-DHtvZSSm.cjs → amount-BV0O-aN8.cjs} +3 -3
  9. package/dist/{amount-D7dj76nH.js → amount-BoYBMgK9.js} +3 -3
  10. package/dist/{arithmetic-C-Q_aI49.js → arithmetic-BhNwisjb.js} +3 -3
  11. package/dist/{arithmetic-Bq-8mSal.cjs → arithmetic-DjT4Kzgt.cjs} +3 -3
  12. package/dist/billing.cjs +2 -2
  13. package/dist/billing.d.cts +1 -1
  14. package/dist/billing.d.ts +1 -1
  15. package/dist/billing.js +2 -2
  16. package/dist/commerce.cjs +7 -7
  17. package/dist/commerce.d.cts +2 -2
  18. package/dist/commerce.d.ts +2 -2
  19. package/dist/commerce.js +7 -7
  20. package/dist/{format-BdB7LEIp.js → format-BdPnijvn.js} +11 -2
  21. package/dist/{format-BnA1aLJk.cjs → format-DLhno7eX.cjs} +16 -1
  22. package/dist/fx.cjs +5 -5
  23. package/dist/fx.d.cts +5 -5
  24. package/dist/fx.d.ts +5 -5
  25. package/dist/fx.js +5 -5
  26. package/dist/index.cjs +10 -7
  27. package/dist/index.d.cts +15 -3
  28. package/dist/index.d.ts +15 -3
  29. package/dist/index.js +8 -8
  30. package/dist/input.cjs +4 -4
  31. package/dist/input.d.cts +2 -2
  32. package/dist/input.d.ts +2 -2
  33. package/dist/input.js +4 -4
  34. package/dist/{iso-minor-CtaiIifs.js → iso-minor-CqkWDxHS.js} +1 -1
  35. package/dist/{iso-minor--gQWI1f2.cjs → iso-minor-wSwJN57T.cjs} +1 -1
  36. package/dist/{medusa-DuQ3-KoD.d.cts → medusa-4K8N1pUc.d.cts} +11 -2
  37. package/dist/{medusa-RwqxaDGq.d.ts → medusa-DBXJXXvF.d.ts} +11 -2
  38. package/dist/{medusa-CmxCni-G.js → medusa-DqJY1qpj.js} +17 -2
  39. package/dist/{medusa-OJ2TJOxt.cjs → medusa-lRY9xlsf.cjs} +22 -1
  40. package/dist/{money-CbhsT0fB.d.cts → money-B-3aFjNJ.d.cts} +19 -3
  41. package/dist/{money-CbhsT0fB.d.ts → money-B-3aFjNJ.d.ts} +19 -3
  42. package/dist/{money-D5-vlv0h.cjs → money-B3wH_Z4S.cjs} +35 -5
  43. package/dist/{money-CIgELekG.js → money-WhnGiI00.js} +18 -6
  44. package/dist/{number-text-BpvN6NAo.cjs → number-text-BWu67jUq.cjs} +1 -1
  45. package/dist/{number-text-C82oh6JB.js → number-text-DE-q4jO5.js} +1 -1
  46. package/dist/{percent-Dt8vNIAW.cjs → percent-C0InC2t2.cjs} +1 -1
  47. package/dist/{percent-CKVI_c-m.js → percent-D1VB9xXG.js} +1 -1
  48. package/dist/{rate-DGPfB_jc.cjs → rate-CVeMii4a.cjs} +1 -1
  49. package/dist/{rate-CmeTGNex.d.ts → rate-DBPiYgT1.d.ts} +1 -1
  50. package/dist/{rate-lLPViBuM.js → rate-DicStBue.js} +1 -1
  51. package/dist/{rate-toyS3EMf.d.cts → rate-tqK8ijG0.d.cts} +1 -1
  52. package/dist/{reporting-DEM97DhQ.d.cts → reporting-CG-ai2sM.d.cts} +2 -2
  53. package/dist/{reporting-5xby-Zas.d.ts → reporting-tpGJbqYp.d.ts} +2 -2
  54. package/dist/{retail-BsvpNv1F.js → retail-1mu888J1.js} +3 -3
  55. package/dist/{retail-Mqd-sPMF.d.cts → retail-C_BPLvMj.d.cts} +1 -1
  56. package/dist/{retail-DTk2XAMM.cjs → retail-Cml8YSKg.cjs} +3 -3
  57. package/dist/{retail-BwcFJcVN.d.ts → retail-DRUTTQoJ.d.ts} +1 -1
  58. package/dist/{rounding-oZ832yTD.cjs → rounding-DHBtNCHG.cjs} +1 -1
  59. package/dist/{rounding-CVAPEfq_.js → rounding-g9rvye0k.js} +1 -1
  60. package/dist/sql.cjs +3 -3
  61. package/dist/sql.d.cts +2 -2
  62. package/dist/sql.d.ts +2 -2
  63. package/dist/sql.js +3 -3
  64. package/dist/testing.cjs +33481 -4
  65. package/dist/testing.d.cts +31 -3
  66. package/dist/testing.d.ts +31 -3
  67. package/dist/testing.js +33481 -5
  68. package/dist/{wire-DQZ6fA3c.cjs → wire-Bhuut8cW.cjs} +259 -34
  69. package/dist/{wire-Cd4Q1Jmm.d.ts → wire-CaUN9Vf_.d.ts} +61 -21
  70. package/dist/{wire-CI3Sm1iC.js → wire-sW0yzqth.js} +248 -35
  71. package/dist/{wire-hWuixv3w.d.cts → wire-xjYXv4go.d.cts} +61 -21
  72. package/dist/wire.cjs +3 -1
  73. package/dist/wire.d.cts +2 -2
  74. package/dist/wire.d.ts +2 -2
  75. package/dist/wire.js +2 -2
  76. package/package.json +1 -1
package/dist/input.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { L as DecimalText, r as Money, y as FractionDigits } from "./money-CbhsT0fB.js";
2
- import { r as Rate } from "./rate-CmeTGNex.js";
1
+ import { R as DecimalText, b as FractionDigits, i as Money } from "./money-B-3aFjNJ.js";
2
+ import { r as Rate } from "./rate-DBPiYgT1.js";
3
3
  //#region src/input/amount.d.ts
4
4
  /** Why typed text is not an acceptable amount. */
5
5
  type ParseFailureReason = 'empty' | 'unparseable' | 'too_many_decimals' | 'negative' | 'zero' | 'below_min' | 'above_max';
package/dist/input.js CHANGED
@@ -1,7 +1,7 @@
1
- import { Z as MoneyError, dt as toDecimalText, et as compareDecimal, it as fractionDigitsOf, lt as roundToScale, rt as formatDecimal, s as storedDecimal, z as decimalOf } from "./money-CIgELekG.js";
2
- import { n as readNumberText } from "./number-text-C82oh6JB.js";
3
- import { c as rateFromDecimal, o as rate } from "./rate-lLPViBuM.js";
4
- import { a as inputStep, i as inputPlaceholder, n as formatAmountInput, o as localeSeparators, r as groupDigits, s as parseAmountInput, t as decimalOfText } from "./amount-D7dj76nH.js";
1
+ import { B as decimalOf, Q as MoneyError, at as fractionDigitsOf, dt as roundToScale, it as formatDecimal, pt as toDecimalText, s as storedDecimal, tt as compareDecimal } from "./money-WhnGiI00.js";
2
+ import { n as readNumberText } from "./number-text-DE-q4jO5.js";
3
+ import { c as rateFromDecimal, o as rate } from "./rate-DicStBue.js";
4
+ import { a as inputStep, i as inputPlaceholder, n as formatAmountInput, o as localeSeparators, r as groupDigits, s as parseAmountInput, t as decimalOfText } from "./amount-BoYBMgK9.js";
5
5
  //#region src/input/import.ts
6
6
  /**
7
7
  * Amount text from a file or a third party to canonical DecimalText (major units, exactly as
@@ -1,4 +1,4 @@
1
- import { E as resolveCurrency, Q as describeValue, Y as mulDiv, Z as MoneyError, ct as pow10, k as storageExponent, s as storedDecimal, st as parseDecimal, t as boundedMoney } from "./money-CIgELekG.js";
1
+ import { $ as describeValue, E as resolveCurrency, Q as MoneyError, X as mulDiv, k as storageExponent, lt as parseDecimal, s as storedDecimal, t as boundedMoney, ut as pow10 } from "./money-WhnGiI00.js";
2
2
  //#region src/iso-minor.ts
3
3
  /**
4
4
  * Internal: stored units per ISO minor unit at `digits`, `storageScale / 10^digits` (100 for
@@ -1,4 +1,4 @@
1
- const require_money = require("./money-D5-vlv0h.cjs");
1
+ const require_money = require("./money-B3wH_Z4S.cjs");
2
2
  //#region src/iso-minor.ts
3
3
  /**
4
4
  * Internal: stored units per ISO minor unit at `digits`, `storageScale / 10^digits` (100 for
@@ -1,4 +1,4 @@
1
- import { L as DecimalText, a as StoredAmount, i as ReadStoredOptions, r as Money } from "./money-CbhsT0fB.cjs";
1
+ import { R as DecimalText, a as ReadStoredOptions, i as Money, o as StoredAmount } from "./money-B-3aFjNJ.cjs";
2
2
  //#region src/medusa.d.ts
3
3
  /**
4
4
  * `row['raw_' + key]` when it is not null/undefined (a failure to read it is final: no
@@ -31,6 +31,15 @@ declare function readStoredDecimal(raw: unknown, options?: ReadStoredDecimalOpti
31
31
  mode?: 'strict';
32
32
  }): DecimalText;
33
33
  declare function readStoredDecimal(raw: unknown, options?: ReadStoredDecimalOptions): DecimalText | null;
34
+ /**
35
+ * A Medusa amount's literal, verbatim (`'4300.00'` stays `'4300.00'`), for SQL and ledger columns:
36
+ * `.value ?? .numeric ?? raw` when it is an unsigned decimal literal without leading zeros
37
+ * (`isDecimalLiteral(text, { leadingZeros: false })`), else null. A number counts only while all
38
+ * its digits are there (finite; a safe integer when whole) and is spelled `String(n)`. Unlike
39
+ * `readStoredDecimal` it neither canonicalizes nor reads `.raw.value`, a bigint or a BigNumber's
40
+ * `valueOf`: the literal is passed on as Medusa holds it.
41
+ */
42
+ declare function readStoredLiteral(raw: unknown): string | null;
34
43
  /**
35
44
  * A variant's `calculated_price` (a number, or an object read through
36
45
  * `raw_calculated_amount` / `calculated_amount`) as Money in
@@ -75,4 +84,4 @@ declare function moneyFor(source: MoneyByCurrency | readonly PriceLike[], curren
75
84
  /** Whether unknown Medusa input holds an amount above zero. `''`, null and garbage are false, never a throw. */
76
85
  declare function isPositiveAmount(raw: unknown): boolean;
77
86
  //#endregion
78
- export { isPositiveAmount as a, readCalculatedPrice as c, toMedusaAmountInput as d, toMedusaRaw as f, ReadStoredDecimalOptions as i, readStoredDecimal as l, MoneyByCurrency as n, moneyByCurrency as o, PriceLike as r, moneyFor as s, MedusaRaw as t, readStoredField as u };
87
+ export { isPositiveAmount as a, readCalculatedPrice as c, readStoredLiteral as d, toMedusaAmountInput as f, ReadStoredDecimalOptions as i, readStoredDecimal as l, MoneyByCurrency as n, moneyByCurrency as o, toMedusaRaw as p, PriceLike as r, moneyFor as s, MedusaRaw as t, readStoredField as u };
@@ -1,4 +1,4 @@
1
- import { L as DecimalText, a as StoredAmount, i as ReadStoredOptions, r as Money } from "./money-CbhsT0fB.js";
1
+ import { R as DecimalText, a as ReadStoredOptions, i as Money, o as StoredAmount } from "./money-B-3aFjNJ.js";
2
2
  //#region src/medusa.d.ts
3
3
  /**
4
4
  * `row['raw_' + key]` when it is not null/undefined (a failure to read it is final: no
@@ -31,6 +31,15 @@ declare function readStoredDecimal(raw: unknown, options?: ReadStoredDecimalOpti
31
31
  mode?: 'strict';
32
32
  }): DecimalText;
33
33
  declare function readStoredDecimal(raw: unknown, options?: ReadStoredDecimalOptions): DecimalText | null;
34
+ /**
35
+ * A Medusa amount's literal, verbatim (`'4300.00'` stays `'4300.00'`), for SQL and ledger columns:
36
+ * `.value ?? .numeric ?? raw` when it is an unsigned decimal literal without leading zeros
37
+ * (`isDecimalLiteral(text, { leadingZeros: false })`), else null. A number counts only while all
38
+ * its digits are there (finite; a safe integer when whole) and is spelled `String(n)`. Unlike
39
+ * `readStoredDecimal` it neither canonicalizes nor reads `.raw.value`, a bigint or a BigNumber's
40
+ * `valueOf`: the literal is passed on as Medusa holds it.
41
+ */
42
+ declare function readStoredLiteral(raw: unknown): string | null;
34
43
  /**
35
44
  * A variant's `calculated_price` (a number, or an object read through
36
45
  * `raw_calculated_amount` / `calculated_amount`) as Money in
@@ -75,4 +84,4 @@ declare function moneyFor(source: MoneyByCurrency | readonly PriceLike[], curren
75
84
  /** Whether unknown Medusa input holds an amount above zero. `''`, null and garbage are false, never a throw. */
76
85
  declare function isPositiveAmount(raw: unknown): boolean;
77
86
  //#endregion
78
- export { isPositiveAmount as a, readCalculatedPrice as c, toMedusaAmountInput as d, toMedusaRaw as f, ReadStoredDecimalOptions as i, readStoredDecimal as l, MoneyByCurrency as n, moneyByCurrency as o, PriceLike as r, moneyFor as s, MedusaRaw as t, readStoredField as u };
87
+ export { isPositiveAmount as a, readCalculatedPrice as c, readStoredLiteral as d, toMedusaAmountInput as f, ReadStoredDecimalOptions as i, readStoredDecimal as l, MoneyByCurrency as n, moneyByCurrency as o, toMedusaRaw as p, PriceLike as r, moneyFor as s, MedusaRaw as t, readStoredField as u };
@@ -1,4 +1,4 @@
1
- import { D as sameCurrency, E as resolveCurrency, Q as describeValue, Z as MoneyError, a as money, at as isPositiveDecimal, b as firstCurrency, d as currencyCode, dt as toDecimalText, i as medusaAmountDecimal, o as readStored, r as isStoredAmount, s as storedDecimal, z as decimalOf } from "./money-CIgELekG.js";
1
+ import { $ as describeValue, B as decimalOf, D as sameCurrency, E as resolveCurrency, G as isDecimalLiteral, Q as MoneyError, a as money, b as firstCurrency, d as currencyCode, ft as strictNumberDecimal, i as medusaAmountDecimal, o as readStored, ot as isPositiveDecimal, pt as toDecimalText, r as isStoredAmount, s as storedDecimal } from "./money-WhnGiI00.js";
2
2
  import { t as hasOwnKey } from "./own-D7544D3k.js";
3
3
  //#region src/medusa.ts
4
4
  const isObject = (value) => typeof value === "object" && value !== null;
@@ -21,6 +21,21 @@ function readStoredDecimal(raw, options = {}) {
21
21
  throw new MoneyError("amount_invalid", `Invalid stored amount: ${describeValue(raw)}`, { field: options.field });
22
22
  }
23
23
  /**
24
+ * A Medusa amount's literal, verbatim (`'4300.00'` stays `'4300.00'`), for SQL and ledger columns:
25
+ * `.value ?? .numeric ?? raw` when it is an unsigned decimal literal without leading zeros
26
+ * (`isDecimalLiteral(text, { leadingZeros: false })`), else null. A number counts only while all
27
+ * its digits are there (finite; a safe integer when whole) and is spelled `String(n)`. Unlike
28
+ * `readStoredDecimal` it neither canonicalizes nor reads `.raw.value`, a bigint or a BigNumber's
29
+ * `valueOf`: the literal is passed on as Medusa holds it.
30
+ */
31
+ function readStoredLiteral(raw) {
32
+ const picked = isObject(raw) ? raw.value ?? raw.numeric ?? raw : raw;
33
+ let literal = null;
34
+ if (typeof picked === "string") literal = picked;
35
+ else if (typeof picked === "number" && strictNumberDecimal(picked) !== null) literal = String(picked);
36
+ return literal !== null && isDecimalLiteral(literal, { leadingZeros: false }) ? literal : null;
37
+ }
38
+ /**
24
39
  * A variant's `calculated_price` (a number, or an object read through
25
40
  * `raw_calculated_amount` / `calculated_amount`) as Money in
26
41
  * `firstCurrency(calculated_price.currency_code, fallbackCurrency)`. Null on anything
@@ -98,4 +113,4 @@ function isPositiveAmount(raw) {
98
113
  return value !== null && isPositiveDecimal(value);
99
114
  }
100
115
  //#endregion
101
- export { readStoredDecimal as a, toMedusaAmountInput as c, readCalculatedPrice as i, toMedusaRaw as l, moneyByCurrency as n, readStoredField as o, moneyFor as r, storedFieldValue as s, isPositiveAmount as t };
116
+ export { readStoredDecimal as a, storedFieldValue as c, readCalculatedPrice as i, toMedusaAmountInput as l, moneyByCurrency as n, readStoredField as o, moneyFor as r, readStoredLiteral as s, isPositiveAmount as t, toMedusaRaw as u };
@@ -1,4 +1,4 @@
1
- const require_money = require("./money-D5-vlv0h.cjs");
1
+ const require_money = require("./money-B3wH_Z4S.cjs");
2
2
  const require_own = require("./own-oP9DXFWv.cjs");
3
3
  //#region src/medusa.ts
4
4
  const isObject = (value) => typeof value === "object" && value !== null;
@@ -21,6 +21,21 @@ function readStoredDecimal(raw, options = {}) {
21
21
  throw new require_money.MoneyError("amount_invalid", `Invalid stored amount: ${require_money.describeValue(raw)}`, { field: options.field });
22
22
  }
23
23
  /**
24
+ * A Medusa amount's literal, verbatim (`'4300.00'` stays `'4300.00'`), for SQL and ledger columns:
25
+ * `.value ?? .numeric ?? raw` when it is an unsigned decimal literal without leading zeros
26
+ * (`isDecimalLiteral(text, { leadingZeros: false })`), else null. A number counts only while all
27
+ * its digits are there (finite; a safe integer when whole) and is spelled `String(n)`. Unlike
28
+ * `readStoredDecimal` it neither canonicalizes nor reads `.raw.value`, a bigint or a BigNumber's
29
+ * `valueOf`: the literal is passed on as Medusa holds it.
30
+ */
31
+ function readStoredLiteral(raw) {
32
+ const picked = isObject(raw) ? raw.value ?? raw.numeric ?? raw : raw;
33
+ let literal = null;
34
+ if (typeof picked === "string") literal = picked;
35
+ else if (typeof picked === "number" && require_money.strictNumberDecimal(picked) !== null) literal = String(picked);
36
+ return literal !== null && require_money.isDecimalLiteral(literal, { leadingZeros: false }) ? literal : null;
37
+ }
38
+ /**
24
39
  * A variant's `calculated_price` (a number, or an object read through
25
40
  * `raw_calculated_amount` / `calculated_amount`) as Money in
26
41
  * `firstCurrency(calculated_price.currency_code, fallbackCurrency)`. Null on anything
@@ -134,6 +149,12 @@ Object.defineProperty(exports, "readStoredField", {
134
149
  return readStoredField;
135
150
  }
136
151
  });
152
+ Object.defineProperty(exports, "readStoredLiteral", {
153
+ enumerable: true,
154
+ get: function() {
155
+ return readStoredLiteral;
156
+ }
157
+ });
137
158
  Object.defineProperty(exports, "storedFieldValue", {
138
159
  enumerable: true,
139
160
  get: function() {
@@ -145,6 +145,16 @@ interface Money {
145
145
  readonly amount: StoredAmount;
146
146
  readonly currency: CurrencyCode;
147
147
  }
148
+ /**
149
+ * A stored amount that may hold a fraction of a storage unit, as Medusa keeps unrounded totals (a
150
+ * tax line can leave 107.8175): a finite number (a safe integer when whole) or plain decimal text
151
+ * (`readStoredDecimal`'s result). `Money` is always whole; the PSP codecs and comparators take
152
+ * either, and `formatStored` formats one.
153
+ */
154
+ interface FractionalMoney {
155
+ readonly amount: number | DecimalText;
156
+ readonly currency: string;
157
+ }
148
158
  interface FromMajorOptions {
149
159
  /**
150
160
  * More fraction digits than the currency stores: `'reject'` (default) throws
@@ -176,6 +186,11 @@ interface ToMajorDecimalOptions {
176
186
  interface ReadStoredOptions {
177
187
  /** `'strict'` (default) throws `amount_invalid` on a bad amount; `'lenient'` returns null. Never 0. */
178
188
  mode?: 'strict' | 'lenient';
189
+ /**
190
+ * A fractional stored amount (Medusa's unrounded totals, 107.8175): `'reject'` (default) reads it
191
+ * as invalid; `'round'` rounds it half-up, exactly, to a whole storage unit (107.8175 gives 108).
192
+ */
193
+ precision?: 'reject' | 'round';
179
194
  /** Names the input field in errors. */
180
195
  field?: string;
181
196
  }
@@ -217,8 +232,9 @@ declare function toMajorNumber(m: Money, options?: ToMajorDecimalOptions): numbe
217
232
  * A stored amount as Medusa hands it over (a number, a numeric string, a raw
218
233
  * `{ value: '4300', precision: 20 }`, a live BigNumber) as Money. Precedence
219
234
  * `.value ?? .raw.value ?? .raw_.value`, then `.numeric ?? .numeric_`, then the
220
- * primitive. `'4300.00'` is accepted; a fractional, non-finite, unsafe or unreadable
221
- * amount throws `amount_invalid`, or gives null with `mode: 'lenient'` (never 0).
235
+ * primitive. `'4300.00'` is accepted; a fractional amount is rounded half-up to a whole
236
+ * storage unit with `precision: 'round'`; otherwise a fractional, non-finite, unsafe or
237
+ * unreadable amount throws `amount_invalid`, or gives null with `mode: 'lenient'` (never 0).
222
238
  * An unknown currency always throws.
223
239
  */
224
240
  declare function readStored(raw: unknown, currency: string, options: ReadStoredOptions & {
@@ -229,4 +245,4 @@ declare function readStored(raw: unknown, currency: string, options?: ReadStored
229
245
  }): Money;
230
246
  declare function readStored(raw: unknown, currency: string, options?: ReadStoredOptions): Money | null;
231
247
  //#endregion
232
- export { localeForCurrency as A, currencyLabel as C, displayDigits as D, currencySymbol as E, storageDigits as F, storageScale as I, DecimalText as L, medusaEpsilon as M, parseCurrencyCode as N, firstCurrency as O, sameCurrency as P, RoundingMode as R, currencyInfo as S, currencyOptions as T, CurrencyInfo as _, StoredAmount as a, StorageScale as b, fromMajor as c, readStored as d, toMajorDecimal as f, CurrencyCodeOptions as g, CurrencyCode as h, ReadStoredOptions as i, medusaCurrencyCode as j, isCurrencyCode as k, isStoredAmount as l, CURRENCIES as m, MajorDecimal as n, StoredAmountOptions as o, toMajorNumber as p, Money as r, ToMajorDecimalOptions as s, FromMajorOptions as t, money as u, CurrencyStatus as v, currencyName as w, currencyCode as x, FractionDigits as y };
248
+ export { isCurrencyCode as A, currencyInfo as C, currencySymbol as D, currencyOptions as E, sameCurrency as F, storageDigits as I, storageScale as L, medusaCurrencyCode as M, medusaEpsilon as N, displayDigits as O, parseCurrencyCode as P, DecimalText as R, currencyCode as S, currencyName as T, CurrencyCodeOptions as _, ReadStoredOptions as a, FractionDigits as b, ToMajorDecimalOptions as c, money as d, readStored as f, CurrencyCode as g, CURRENCIES as h, Money as i, localeForCurrency as j, firstCurrency as k, fromMajor as l, toMajorNumber as m, FromMajorOptions as n, StoredAmount as o, toMajorDecimal as p, MajorDecimal as r, StoredAmountOptions as s, FractionalMoney as t, isStoredAmount as u, CurrencyInfo as v, currencyLabel as w, StorageScale as x, CurrencyStatus as y, RoundingMode as z };
@@ -145,6 +145,16 @@ interface Money {
145
145
  readonly amount: StoredAmount;
146
146
  readonly currency: CurrencyCode;
147
147
  }
148
+ /**
149
+ * A stored amount that may hold a fraction of a storage unit, as Medusa keeps unrounded totals (a
150
+ * tax line can leave 107.8175): a finite number (a safe integer when whole) or plain decimal text
151
+ * (`readStoredDecimal`'s result). `Money` is always whole; the PSP codecs and comparators take
152
+ * either, and `formatStored` formats one.
153
+ */
154
+ interface FractionalMoney {
155
+ readonly amount: number | DecimalText;
156
+ readonly currency: string;
157
+ }
148
158
  interface FromMajorOptions {
149
159
  /**
150
160
  * More fraction digits than the currency stores: `'reject'` (default) throws
@@ -176,6 +186,11 @@ interface ToMajorDecimalOptions {
176
186
  interface ReadStoredOptions {
177
187
  /** `'strict'` (default) throws `amount_invalid` on a bad amount; `'lenient'` returns null. Never 0. */
178
188
  mode?: 'strict' | 'lenient';
189
+ /**
190
+ * A fractional stored amount (Medusa's unrounded totals, 107.8175): `'reject'` (default) reads it
191
+ * as invalid; `'round'` rounds it half-up, exactly, to a whole storage unit (107.8175 gives 108).
192
+ */
193
+ precision?: 'reject' | 'round';
179
194
  /** Names the input field in errors. */
180
195
  field?: string;
181
196
  }
@@ -217,8 +232,9 @@ declare function toMajorNumber(m: Money, options?: ToMajorDecimalOptions): numbe
217
232
  * A stored amount as Medusa hands it over (a number, a numeric string, a raw
218
233
  * `{ value: '4300', precision: 20 }`, a live BigNumber) as Money. Precedence
219
234
  * `.value ?? .raw.value ?? .raw_.value`, then `.numeric ?? .numeric_`, then the
220
- * primitive. `'4300.00'` is accepted; a fractional, non-finite, unsafe or unreadable
221
- * amount throws `amount_invalid`, or gives null with `mode: 'lenient'` (never 0).
235
+ * primitive. `'4300.00'` is accepted; a fractional amount is rounded half-up to a whole
236
+ * storage unit with `precision: 'round'`; otherwise a fractional, non-finite, unsafe or
237
+ * unreadable amount throws `amount_invalid`, or gives null with `mode: 'lenient'` (never 0).
222
238
  * An unknown currency always throws.
223
239
  */
224
240
  declare function readStored(raw: unknown, currency: string, options: ReadStoredOptions & {
@@ -229,4 +245,4 @@ declare function readStored(raw: unknown, currency: string, options?: ReadStored
229
245
  }): Money;
230
246
  declare function readStored(raw: unknown, currency: string, options?: ReadStoredOptions): Money | null;
231
247
  //#endregion
232
- export { localeForCurrency as A, currencyLabel as C, displayDigits as D, currencySymbol as E, storageDigits as F, storageScale as I, DecimalText as L, medusaEpsilon as M, parseCurrencyCode as N, firstCurrency as O, sameCurrency as P, RoundingMode as R, currencyInfo as S, currencyOptions as T, CurrencyInfo as _, StoredAmount as a, StorageScale as b, fromMajor as c, readStored as d, toMajorDecimal as f, CurrencyCodeOptions as g, CurrencyCode as h, ReadStoredOptions as i, medusaCurrencyCode as j, isCurrencyCode as k, isStoredAmount as l, CURRENCIES as m, MajorDecimal as n, StoredAmountOptions as o, toMajorNumber as p, Money as r, ToMajorDecimalOptions as s, FromMajorOptions as t, money as u, CurrencyStatus as v, currencyName as w, currencyCode as x, FractionDigits as y };
248
+ export { isCurrencyCode as A, currencyInfo as C, currencySymbol as D, currencyOptions as E, sameCurrency as F, storageDigits as I, storageScale as L, medusaCurrencyCode as M, medusaEpsilon as N, displayDigits as O, parseCurrencyCode as P, DecimalText as R, currencyCode as S, currencyName as T, CurrencyCodeOptions as _, ReadStoredOptions as a, FractionDigits as b, ToMajorDecimalOptions as c, money as d, readStored as f, CurrencyCode as g, CURRENCIES as h, Money as i, localeForCurrency as j, firstCurrency as k, fromMajor as l, toMajorNumber as m, FromMajorOptions as n, StoredAmount as o, toMajorDecimal as p, MajorDecimal as r, StoredAmountOptions as s, FractionalMoney as t, isStoredAmount as u, CurrencyInfo as v, currencyLabel as w, StorageScale as x, CurrencyStatus as y, RoundingMode as z };
@@ -276,6 +276,18 @@ function decimalRound(a, options) {
276
276
  function decimalCompare(a, b) {
277
277
  return compareDecimal(decimalOf(a), decimalOf(b));
278
278
  }
279
+ /**
280
+ * Whether `a` and `b` are the same decimal, exactly (`'43.0'` equals `'43.00'` and `43`). Takes what
281
+ * `decimalCompare` takes, but never throws: anything that is not plain decimal text, a finite number
282
+ * or a bigint is never equal, not even to itself.
283
+ */
284
+ function decimalEquals(a, b) {
285
+ try {
286
+ return compareDecimal(decimalOf(a), decimalOf(b)) === 0;
287
+ } catch {
288
+ return false;
289
+ }
290
+ }
279
291
  /** `a` limited to `[min, max]` (either bound optional). `min` above `max` throws `amount_invalid`. */
280
292
  function decimalClamp(a, bounds) {
281
293
  const value = decimalOf(a);
@@ -3553,16 +3565,16 @@ function medusaAmountDecimal(raw) {
3553
3565
  return typeof primitive === "string" ? parseDecimal(primitive) : null;
3554
3566
  }
3555
3567
  const SAFE_LIMIT = BigInt(Number.MAX_SAFE_INTEGER);
3556
- /** A stored integer from Medusa's shapes, or null when it is fractional, unsafe or unreadable. */
3557
- function unwrapStored(raw) {
3568
+ /** A stored integer from Medusa's shapes (a fraction rounded half-up with `round`), or null when it is fractional, unsafe or unreadable. */
3569
+ function unwrapStored(raw, round) {
3558
3570
  const parsed = medusaAmountDecimal(raw);
3559
- if (!parsed || fractionDigitsOf(parsed) !== 0) return null;
3560
- const whole = roundToScale(parsed, 0, "down");
3571
+ if (!parsed || !round && fractionDigitsOf(parsed) !== 0) return null;
3572
+ const whole = roundToScale(parsed, 0, "half-up");
3561
3573
  return unitsWithin(whole, SAFE_LIMIT) ? Number(whole.units) : null;
3562
3574
  }
3563
3575
  function readStored(raw, currency, options = {}) {
3564
3576
  const info = anyKnownCurrency(currency, options.field);
3565
- const amount = unwrapStored(raw);
3577
+ const amount = unwrapStored(raw, options.precision === "round");
3566
3578
  if (amount !== null) return storedFrom(amount, info);
3567
3579
  if (options.mode === "lenient") return null;
3568
3580
  throw new MoneyError("amount_invalid", `Invalid stored amount: ${describeValue(raw)}`, { field: options.field });
@@ -3670,6 +3682,12 @@ Object.defineProperty(exports, "decimalDivide", {
3670
3682
  return decimalDivide;
3671
3683
  }
3672
3684
  });
3685
+ Object.defineProperty(exports, "decimalEquals", {
3686
+ enumerable: true,
3687
+ get: function() {
3688
+ return decimalEquals;
3689
+ }
3690
+ });
3673
3691
  Object.defineProperty(exports, "decimalFromNumber", {
3674
3692
  enumerable: true,
3675
3693
  get: function() {
@@ -3832,6 +3850,12 @@ Object.defineProperty(exports, "multiplyDecimal", {
3832
3850
  return multiplyDecimal;
3833
3851
  }
3834
3852
  });
3853
+ Object.defineProperty(exports, "normalizeDecimal", {
3854
+ enumerable: true,
3855
+ get: function() {
3856
+ return normalizeDecimal;
3857
+ }
3858
+ });
3835
3859
  Object.defineProperty(exports, "numberFormat", {
3836
3860
  enumerable: true,
3837
3861
  get: function() {
@@ -3958,3 +3982,9 @@ Object.defineProperty(exports, "trimDecimalZeros", {
3958
3982
  return trimDecimalZeros;
3959
3983
  }
3960
3984
  });
3985
+ Object.defineProperty(exports, "unitsWithin", {
3986
+ enumerable: true,
3987
+ get: function() {
3988
+ return unitsWithin;
3989
+ }
3990
+ });
@@ -276,6 +276,18 @@ function decimalRound(a, options) {
276
276
  function decimalCompare(a, b) {
277
277
  return compareDecimal(decimalOf(a), decimalOf(b));
278
278
  }
279
+ /**
280
+ * Whether `a` and `b` are the same decimal, exactly (`'43.0'` equals `'43.00'` and `43`). Takes what
281
+ * `decimalCompare` takes, but never throws: anything that is not plain decimal text, a finite number
282
+ * or a bigint is never equal, not even to itself.
283
+ */
284
+ function decimalEquals(a, b) {
285
+ try {
286
+ return compareDecimal(decimalOf(a), decimalOf(b)) === 0;
287
+ } catch {
288
+ return false;
289
+ }
290
+ }
279
291
  /** `a` limited to `[min, max]` (either bound optional). `min` above `max` throws `amount_invalid`. */
280
292
  function decimalClamp(a, bounds) {
281
293
  const value = decimalOf(a);
@@ -3553,19 +3565,19 @@ function medusaAmountDecimal(raw) {
3553
3565
  return typeof primitive === "string" ? parseDecimal(primitive) : null;
3554
3566
  }
3555
3567
  const SAFE_LIMIT = BigInt(Number.MAX_SAFE_INTEGER);
3556
- /** A stored integer from Medusa's shapes, or null when it is fractional, unsafe or unreadable. */
3557
- function unwrapStored(raw) {
3568
+ /** A stored integer from Medusa's shapes (a fraction rounded half-up with `round`), or null when it is fractional, unsafe or unreadable. */
3569
+ function unwrapStored(raw, round) {
3558
3570
  const parsed = medusaAmountDecimal(raw);
3559
- if (!parsed || fractionDigitsOf(parsed) !== 0) return null;
3560
- const whole = roundToScale(parsed, 0, "down");
3571
+ if (!parsed || !round && fractionDigitsOf(parsed) !== 0) return null;
3572
+ const whole = roundToScale(parsed, 0, "half-up");
3561
3573
  return unitsWithin(whole, SAFE_LIMIT) ? Number(whole.units) : null;
3562
3574
  }
3563
3575
  function readStored(raw, currency, options = {}) {
3564
3576
  const info = anyKnownCurrency(currency, options.field);
3565
- const amount = unwrapStored(raw);
3577
+ const amount = unwrapStored(raw, options.precision === "round");
3566
3578
  if (amount !== null) return storedFrom(amount, info);
3567
3579
  if (options.mode === "lenient") return null;
3568
3580
  throw new MoneyError("amount_invalid", `Invalid stored amount: ${describeValue(raw)}`, { field: options.field });
3569
3581
  }
3570
3582
  //#endregion
3571
- export { addDecimal as $, storageScale as A, decimalRound as B, medusaCurrencyCode as C, sameCurrency as D, resolveCurrency as E, decimalClamp as F, parseDecimalText as G, decimalSum as H, decimalCompare as I, gcd as J, trimDecimalZeros as K, decimalDivide as L, resolveLocale as M, separatorsOf as N, storageDigits as O, assertDecimalLiteral as P, describeValue as Q, decimalMultiply as R, localeForCurrency as S, parseCurrencyCode as T, decimalWithin as U, decimalSubtract as V, isDecimalLiteral as W, ratioToDecimal as X, mulDiv as Y, MoneyError as Z, currencySymbol as _, money as a, isPositiveDecimal as at, firstCurrency as b, toMajorDecimal as c, pow10 as ct, currencyCode as d, toDecimalText as dt, compareDecimal as et, currencyInfo as f, currencyOptions as g, currencyName as h, medusaAmountDecimal as i, fractionDigitsOf as it, numberFormat as j, storageExponent as k, toMajorNumber as l, roundToScale as lt, currencyMarks as m, fromMajor as n, divRound as nt, readStored as o, multiplyDecimal as ot, currencyLabel as p, compareRatio as q, isStoredAmount as r, formatDecimal as rt, storedDecimal as s, parseDecimal as st, boundedMoney as t, decimalFromNumber as tt, CURRENCIES as u, strictNumberDecimal as ut, displayDigits as v, medusaEpsilon as w, isCurrencyCode as x, findCurrency as y, decimalOf as z };
3583
+ export { describeValue as $, storageScale as A, decimalOf as B, medusaCurrencyCode as C, sameCurrency as D, resolveCurrency as E, decimalClamp as F, isDecimalLiteral as G, decimalSubtract as H, decimalCompare as I, compareRatio as J, parseDecimalText as K, decimalDivide as L, resolveLocale as M, separatorsOf as N, storageDigits as O, assertDecimalLiteral as P, MoneyError as Q, decimalEquals as R, localeForCurrency as S, parseCurrencyCode as T, decimalSum as U, decimalRound as V, decimalWithin as W, mulDiv as X, gcd as Y, ratioToDecimal as Z, currencySymbol as _, money as a, fractionDigitsOf as at, firstCurrency as b, toMajorDecimal as c, normalizeDecimal as ct, currencyCode as d, roundToScale as dt, addDecimal as et, currencyInfo as f, strictNumberDecimal as ft, currencyOptions as g, currencyName as h, medusaAmountDecimal as i, formatDecimal as it, numberFormat as j, storageExponent as k, toMajorNumber as l, parseDecimal as lt, currencyMarks as m, unitsWithin as mt, fromMajor as n, decimalFromNumber as nt, readStored as o, isPositiveDecimal as ot, currencyLabel as p, toDecimalText as pt, trimDecimalZeros as q, isStoredAmount as r, divRound as rt, storedDecimal as s, multiplyDecimal as st, boundedMoney as t, compareDecimal as tt, CURRENCIES as u, pow10 as ut, displayDigits as v, medusaEpsilon as w, isCurrencyCode as x, findCurrency as y, decimalMultiply as z };
@@ -1,4 +1,4 @@
1
- const require_money = require("./money-D5-vlv0h.cjs");
1
+ const require_money = require("./money-B3wH_Z4S.cjs");
2
2
  //#region src/internal/number-text.ts
3
3
  const MINUS = /^[-−]/;
4
4
  const escapeRegExp = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -1,4 +1,4 @@
1
- import { E as resolveCurrency, Q as describeValue, lt as roundToScale, m as currencyMarks } from "./money-CIgELekG.js";
1
+ import { $ as describeValue, E as resolveCurrency, dt as roundToScale, m as currencyMarks } from "./money-WhnGiI00.js";
2
2
  //#region src/internal/number-text.ts
3
3
  const MINUS = /^[-−]/;
4
4
  const escapeRegExp = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -1,4 +1,4 @@
1
- const require_money = require("./money-D5-vlv0h.cjs");
1
+ const require_money = require("./money-B3wH_Z4S.cjs");
2
2
  //#region src/internal/percent.ts
3
3
  /** 100% for a percent written with `scale` fraction digits: the denominator of its units. */
4
4
  function hundredPercent(scale) {
@@ -1,4 +1,4 @@
1
- import { X as ratioToDecimal, Y as mulDiv, ct as pow10 } from "./money-CIgELekG.js";
1
+ import { X as mulDiv, Z as ratioToDecimal, ut as pow10 } from "./money-WhnGiI00.js";
2
2
  //#region src/internal/percent.ts
3
3
  /** 100% for a percent written with `scale` fraction digits: the denominator of its units. */
4
4
  function hundredPercent(scale) {
@@ -1,4 +1,4 @@
1
- const require_money = require("./money-D5-vlv0h.cjs");
1
+ const require_money = require("./money-B3wH_Z4S.cjs");
2
2
  const require_own = require("./own-oP9DXFWv.cjs");
3
3
  //#region src/fx/rate.ts
4
4
  /** Denominator of every locked rate (`store_currency_rate.rate_denominator` default): 7 decimals. */
@@ -1,4 +1,4 @@
1
- import { L as DecimalText } from "./money-CbhsT0fB.js";
1
+ import { R as DecimalText } from "./money-B-3aFjNJ.js";
2
2
  //#region src/fx/rate.d.ts
3
3
  /** 1 base unit = numerator / denominator quote units, both in major units. Positive integers. */
4
4
  interface Rate {
@@ -1,4 +1,4 @@
1
- import { Q as describeValue, X as ratioToDecimal, Z as MoneyError, ct as pow10, dt as toDecimalText, lt as roundToScale, q as compareRatio, st as parseDecimal, z as decimalOf } from "./money-CIgELekG.js";
1
+ import { $ as describeValue, B as decimalOf, J as compareRatio, Q as MoneyError, Z as ratioToDecimal, dt as roundToScale, lt as parseDecimal, pt as toDecimalText, ut as pow10 } from "./money-WhnGiI00.js";
2
2
  import { t as hasOwnKey } from "./own-D7544D3k.js";
3
3
  //#region src/fx/rate.ts
4
4
  /** Denominator of every locked rate (`store_currency_rate.rate_denominator` default): 7 decimals. */
@@ -1,4 +1,4 @@
1
- import { L as DecimalText } from "./money-CbhsT0fB.cjs";
1
+ import { R as DecimalText } from "./money-B-3aFjNJ.cjs";
2
2
  //#region src/fx/rate.d.ts
3
3
  /** 1 base unit = numerator / denominator quote units, both in major units. Positive integers. */
4
4
  interface Rate {
@@ -1,5 +1,5 @@
1
- import { L as DecimalText, h as CurrencyCode, r as Money } from "./money-CbhsT0fB.cjs";
2
- import { a as RateRow } from "./rate-toyS3EMf.cjs";
1
+ import { R as DecimalText, g as CurrencyCode, i as Money } from "./money-B-3aFjNJ.cjs";
2
+ import { a as RateRow } from "./rate-tqK8ijG0.cjs";
3
3
  //#region src/fx/reporting.d.ts
4
4
  /** `factors[lower code]` takes a stored amount in that currency to a stored amount in `base`. */
5
5
  interface FactorTable {
@@ -1,5 +1,5 @@
1
- import { L as DecimalText, h as CurrencyCode, r as Money } from "./money-CbhsT0fB.js";
2
- import { a as RateRow } from "./rate-CmeTGNex.js";
1
+ import { R as DecimalText, g as CurrencyCode, i as Money } from "./money-B-3aFjNJ.js";
2
+ import { a as RateRow } from "./rate-DBPiYgT1.js";
3
3
  //#region src/fx/reporting.d.ts
4
4
  /** `factors[lower code]` takes a stored amount in that currency to a stored amount in `base`. */
5
5
  interface FactorTable {
@@ -1,6 +1,6 @@
1
- import { E as resolveCurrency, Q as describeValue, Z as MoneyError, nt as divRound, s as storedDecimal, t as boundedMoney } from "./money-CIgELekG.js";
2
- import { a as unitSize, t as mulDivToUnit } from "./rounding-CVAPEfq_.js";
3
- import { r as percentOfUnits } from "./percent-CKVI_c-m.js";
1
+ import { $ as describeValue, E as resolveCurrency, Q as MoneyError, rt as divRound, s as storedDecimal, t as boundedMoney } from "./money-WhnGiI00.js";
2
+ import { a as unitSize, t as mulDivToUnit } from "./rounding-g9rvye0k.js";
3
+ import { r as percentOfUnits } from "./percent-D1VB9xXG.js";
4
4
  //#region src/fx/retail.ts
5
5
  const RETAIL_ROUNDINGS = [
6
6
  "none",
@@ -1,4 +1,4 @@
1
- import { r as Money } from "./money-CbhsT0fB.cjs";
1
+ import { i as Money } from "./money-B-3aFjNJ.cjs";
2
2
  //#region src/fx/retail.d.ts
3
3
  /**
4
4
  * - `'none'`: Medusa `applyRounding` 'none': a zero-decimal currency is rounded to a whole
@@ -1,6 +1,6 @@
1
- const require_money = require("./money-D5-vlv0h.cjs");
2
- const require_rounding = require("./rounding-oZ832yTD.cjs");
3
- const require_percent = require("./percent-Dt8vNIAW.cjs");
1
+ const require_money = require("./money-B3wH_Z4S.cjs");
2
+ const require_rounding = require("./rounding-DHBtNCHG.cjs");
3
+ const require_percent = require("./percent-C0InC2t2.cjs");
4
4
  //#region src/fx/retail.ts
5
5
  const RETAIL_ROUNDINGS = [
6
6
  "none",
@@ -1,4 +1,4 @@
1
- import { r as Money } from "./money-CbhsT0fB.js";
1
+ import { i as Money } from "./money-B-3aFjNJ.js";
2
2
  //#region src/fx/retail.d.ts
3
3
  /**
4
4
  * - `'none'`: Medusa `applyRounding` 'none': a zero-decimal currency is rounded to a whole
@@ -1,4 +1,4 @@
1
- const require_money = require("./money-D5-vlv0h.cjs");
1
+ const require_money = require("./money-B3wH_Z4S.cjs");
2
2
  //#region src/rounding.ts
3
3
  /** Internal: the size of `unit` in storage units. */
4
4
  function unitSize(info, unit) {
@@ -1,4 +1,4 @@
1
- import { E as resolveCurrency, Y as mulDiv, Z as MoneyError, ct as pow10, lt as roundToScale, rt as formatDecimal, s as storedDecimal, t as boundedMoney, z as decimalOf } from "./money-CIgELekG.js";
1
+ import { B as decimalOf, E as resolveCurrency, Q as MoneyError, X as mulDiv, dt as roundToScale, it as formatDecimal, s as storedDecimal, t as boundedMoney, ut as pow10 } from "./money-WhnGiI00.js";
2
2
  //#region src/rounding.ts
3
3
  /** Internal: the size of `unit` in storage units. */
4
4
  function unitSize(info, unit) {
package/dist/sql.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_money = require("./money-D5-vlv0h.cjs");
3
- const require_rate = require("./rate-DGPfB_jc.cjs");
4
- const require_retail = require("./retail-DTk2XAMM.cjs");
2
+ const require_money = require("./money-B3wH_Z4S.cjs");
3
+ const require_rate = require("./rate-CVeMii4a.cjs");
4
+ const require_retail = require("./retail-Cml8YSKg.cjs");
5
5
  //#region src/sql/guard.ts
6
6
  const STATEMENT_BREAKERS = /;|--|\/\*|\*\/|\0/;
7
7
  const refuse = (name, value) => new require_money.MoneyError("parse", `${name} must be a SQL expression written in code, got ${require_money.describeValue(value)}`);
package/dist/sql.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { r as Rate } from "./rate-toyS3EMf.cjs";
2
- import { t as FactorTable } from "./reporting-DEM97DhQ.cjs";
1
+ import { r as Rate } from "./rate-tqK8ijG0.cjs";
2
+ import { t as FactorTable } from "./reporting-CG-ai2sM.cjs";
3
3
  //#region src/sql/guard.d.ts
4
4
  type SqlBinding = string | number;
5
5
  /** Text with knex `?` placeholders and the values they bind, in order: `knex.raw(f.sql, f.bindings)`. */
package/dist/sql.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { r as Rate } from "./rate-CmeTGNex.js";
2
- import { t as FactorTable } from "./reporting-5xby-Zas.js";
1
+ import { r as Rate } from "./rate-DBPiYgT1.js";
2
+ import { t as FactorTable } from "./reporting-tpGJbqYp.js";
3
3
  //#region src/sql/guard.d.ts
4
4
  type SqlBinding = string | number;
5
5
  /** Text with knex `?` placeholders and the values they bind, in order: `knex.raw(f.sql, f.bindings)`. */
package/dist/sql.js CHANGED
@@ -1,6 +1,6 @@
1
- import { A as storageScale, E as resolveCurrency, Q as describeValue, Z as MoneyError, u as CURRENCIES } from "./money-CIgELekG.js";
2
- import { r as checkRate } from "./rate-lLPViBuM.js";
3
- import { t as priceRoundingParams } from "./retail-BsvpNv1F.js";
1
+ import { $ as describeValue, A as storageScale, E as resolveCurrency, Q as MoneyError, u as CURRENCIES } from "./money-WhnGiI00.js";
2
+ import { r as checkRate } from "./rate-DicStBue.js";
3
+ import { t as priceRoundingParams } from "./retail-1mu888J1.js";
4
4
  //#region src/sql/guard.ts
5
5
  const STATEMENT_BREAKERS = /;|--|\/\*|\*\/|\0/;
6
6
  const refuse = (name, value) => new MoneyError("parse", `${name} must be a SQL expression written in code, got ${describeValue(value)}`);