soff-money 0.1.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 (44) hide show
  1. package/README.md +75 -0
  2. package/dist/core/index.cjs +244 -0
  3. package/dist/core/index.cjs.map +1 -0
  4. package/dist/core/index.d.cts +181 -0
  5. package/dist/core/index.d.ts +181 -0
  6. package/dist/core/index.js +242 -0
  7. package/dist/core/index.js.map +1 -0
  8. package/dist/index.cjs +309 -0
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.d.cts +6 -0
  11. package/dist/index.d.ts +6 -0
  12. package/dist/index.js +301 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/locales/ar.cjs +16 -0
  15. package/dist/locales/ar.cjs.map +1 -0
  16. package/dist/locales/ar.d.cts +9 -0
  17. package/dist/locales/ar.d.ts +9 -0
  18. package/dist/locales/ar.js +14 -0
  19. package/dist/locales/ar.js.map +1 -0
  20. package/dist/locales/br.cjs +16 -0
  21. package/dist/locales/br.cjs.map +1 -0
  22. package/dist/locales/br.d.cts +9 -0
  23. package/dist/locales/br.d.ts +9 -0
  24. package/dist/locales/br.js +14 -0
  25. package/dist/locales/br.js.map +1 -0
  26. package/dist/locales/co.cjs +21 -0
  27. package/dist/locales/co.cjs.map +1 -0
  28. package/dist/locales/co.d.cts +14 -0
  29. package/dist/locales/co.d.ts +14 -0
  30. package/dist/locales/co.js +18 -0
  31. package/dist/locales/co.js.map +1 -0
  32. package/dist/locales/mx.cjs +16 -0
  33. package/dist/locales/mx.cjs.map +1 -0
  34. package/dist/locales/mx.d.cts +9 -0
  35. package/dist/locales/mx.d.ts +9 -0
  36. package/dist/locales/mx.js +14 -0
  37. package/dist/locales/mx.js.map +1 -0
  38. package/dist/locales/us.cjs +16 -0
  39. package/dist/locales/us.cjs.map +1 -0
  40. package/dist/locales/us.d.cts +9 -0
  41. package/dist/locales/us.d.ts +9 -0
  42. package/dist/locales/us.js +14 -0
  43. package/dist/locales/us.js.map +1 -0
  44. package/package.json +135 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/money.ts","../src/locales/co.ts","../src/locales/mx.ts","../src/locales/ar.ts","../src/locales/br.ts","../src/locales/us.ts"],"names":[],"mappings":";AAKO,IAAM,KAAA,GAAN,MAAM,MAAA,CAAwB;AAAA,EAI3B,WAAA,CAAY,OAAe,QAAA,EAAoB;AACrD,IAAA,IAAI,CAAC,MAAA,CAAO,SAAA,CAAU,KAAK,CAAA,EAAG;AAC5B,MAAA,MAAM,IAAI,MAAM,uDAAuD,CAAA;AAAA,IACzE;AACA,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AACb,IAAA,IAAA,CAAK,QAAA,GAAW,QAAA;AAChB,IAAA,MAAA,CAAO,OAAO,IAAI,CAAA;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,SAAA,CAAU,KAAA,EAAe,QAAA,EAA2B;AACzD,IAAA,OAAO,IAAI,MAAA,CAAM,IAAA,CAAK,KAAA,CAAM,KAAK,GAAG,QAAQ,CAAA;AAAA,EAC9C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO,WAAA,CAAY,MAAA,EAAgB,QAAA,EAA2B;AAC5D,IAAA,MAAM,UAAA,GAAa,IAAA,CAAK,GAAA,CAAI,EAAA,EAAI,SAAS,QAAQ,CAAA;AACjD,IAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,KAAA,CAAM,MAAA,GAAS,UAAU,CAAA;AAC5C,IAAA,OAAO,IAAI,MAAA,CAAM,KAAA,EAAO,QAAQ,CAAA;AAAA,EAClC;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,KAAK,QAAA,EAA2B;AACrC,IAAA,OAAO,IAAI,MAAA,CAAM,CAAA,EAAG,QAAQ,CAAA;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,KAAA,EAAsB;AACxB,IAAA,IAAA,CAAK,mBAAmB,KAAK,CAAA;AAC7B,IAA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AAAA,EACN,MAAA,EAAQ,IAAA;AAAA,EACR,QAAA,EAAU,CAAA;AAAA,EACV,kBAAA,EAAoB,GAAA;AAAA,EACpB,gBAAA,EAAkB,GAAA;AAAA,EAClB,cAAA,EAAgB,QAAA;AAAA,EAChB,aAAA,EAAe;AACjB;;;ACRO,IAAM,GAAA,GAAgB;AAAA,EAC3B,IAAA,EAAM,KAAA;AAAA,EACN,MAAA,EAAQ,GAAA;AAAA,EACR,QAAA,EAAU,CAAA;AAAA,EACV,kBAAA,EAAoB,GAAA;AAAA,EACpB,gBAAA,EAAkB,GAAA;AAAA,EAClB,cAAA,EAAgB,QAAA;AAAA,EAChB,aAAA,EAAe;AACjB","file":"index.js","sourcesContent":["import type { Currency, FormatOptions, IMoney } from './types.js';\n\n/**\n * Immutable Money class that uses integer arithmetic for precision\n */\nexport class Money implements IMoney {\n readonly cents: number;\n readonly currency: Currency;\n\n private constructor(cents: number, currency: Currency) {\n if (!Number.isInteger(cents)) {\n throw new Error('Money must be created with an integer number of cents');\n }\n this.cents = cents;\n this.currency = currency;\n Object.freeze(this);\n }\n\n /**\n * Create money from cents (smallest unit)\n */\n static fromCents(cents: number, currency: Currency): Money {\n return new Money(Math.round(cents), currency);\n }\n\n /**\n * Create money from a decimal amount\n * @example Money.fromDecimal(100.50, USD) creates $100.50\n */\n static fromDecimal(amount: number, currency: Currency): Money {\n const multiplier = Math.pow(10, currency.decimals);\n const cents = Math.round(amount * multiplier);\n return new Money(cents, currency);\n }\n\n /**\n * Create zero money\n */\n static zero(currency: Currency): Money {\n return new Money(0, currency);\n }\n\n /**\n * Add another money value (must be same currency)\n */\n add(other: IMoney): Money {\n this.assertSameCurrency(other);\n return new Money(this.cents + other.cents, this.currency);\n }\n\n /**\n * Subtract another money value (must be same currency)\n */\n subtract(other: IMoney): Money {\n this.assertSameCurrency(other);\n return new Money(this.cents - other.cents, this.currency);\n }\n\n /**\n * Multiply by a factor (rounds to nearest cent)\n */\n multiply(factor: number): Money {\n return new Money(Math.round(this.cents * factor), this.currency);\n }\n\n /**\n * Divide by a divisor (rounds to nearest cent)\n */\n divide(divisor: number): Money {\n if (divisor === 0) {\n throw new Error('Cannot divide by zero');\n }\n return new Money(Math.round(this.cents / divisor), this.currency);\n }\n\n /**\n * Distribute money evenly without losing cents\n * The remainder is distributed to the first parts\n * @example $100 / 3 = [$33.34, $33.33, $33.33]\n */\n distribute(parts: number): Money[] {\n if (parts <= 0 || !Number.isInteger(parts)) {\n throw new Error('Parts must be a positive integer');\n }\n\n const quotient = Math.floor(this.cents / parts);\n const remainder = this.cents % parts;\n\n const result: Money[] = [];\n for (let i = 0; i < parts; i++) {\n // Add 1 cent to the first 'remainder' parts\n const extra = i < remainder ? 1 : 0;\n result.push(new Money(quotient + extra, this.currency));\n }\n\n return result;\n }\n\n /**\n * Distribute money according to ratios\n * @example $100 with ratios [1, 2, 2] = [$20, $40, $40]\n */\n distributeByRatios(ratios: number[]): Money[] {\n if (ratios.length === 0) {\n throw new Error('Ratios array cannot be empty');\n }\n\n const total = ratios.reduce((sum, r) => sum + r, 0);\n if (total <= 0) {\n throw new Error('Sum of ratios must be positive');\n }\n\n let remaining = this.cents;\n const result: Money[] = [];\n\n for (let i = 0; i < ratios.length; i++) {\n if (i === ratios.length - 1) {\n // Last part gets whatever is remaining to avoid rounding errors\n result.push(new Money(remaining, this.currency));\n } else {\n const share = Math.round((this.cents * ratios[i]) / total);\n result.push(new Money(share, this.currency));\n remaining -= share;\n }\n }\n\n return result;\n }\n\n /**\n * Format money for display\n */\n format(options: FormatOptions = {}): string {\n const { showSymbol = true, showDecimals = true, symbolPosition } = options;\n\n const decimal = this.toDecimal();\n const absValue = Math.abs(decimal);\n const isNegative = decimal < 0;\n\n // Format the number\n let formatted: string;\n if (showDecimals && this.currency.decimals > 0) {\n const [intPart, decPart] = absValue.toFixed(this.currency.decimals).split('.');\n const intFormatted = this.formatInteger(intPart);\n formatted = `${intFormatted}${this.currency.decimalSeparator}${decPart}`;\n } else {\n formatted = this.formatInteger(Math.round(absValue).toString());\n }\n\n // Add negative sign\n if (isNegative) {\n formatted = `-${formatted}`;\n }\n\n // Add symbol\n if (showSymbol) {\n const pos = symbolPosition ?? this.currency.symbolPosition;\n const space = this.currency.symbolSpacing ? ' ' : '';\n\n if (pos === 'before') {\n formatted = `${this.currency.symbol}${space}${formatted}`;\n } else {\n formatted = `${formatted}${space}${this.currency.symbol}`;\n }\n }\n\n return formatted;\n }\n\n /**\n * Get the decimal representation\n */\n toDecimal(): number {\n return this.cents / Math.pow(10, this.currency.decimals);\n }\n\n /**\n * Check equality with another money value\n */\n equals(other: IMoney): boolean {\n return this.cents === other.cents && this.currency.code === other.currency.code;\n }\n\n /**\n * Check if greater than another money value\n */\n greaterThan(other: IMoney): boolean {\n this.assertSameCurrency(other);\n return this.cents > other.cents;\n }\n\n /**\n * Check if less than another money value\n */\n lessThan(other: IMoney): boolean {\n this.assertSameCurrency(other);\n return this.cents < other.cents;\n }\n\n /**\n * Check if greater than or equal\n */\n greaterThanOrEqual(other: IMoney): boolean {\n this.assertSameCurrency(other);\n return this.cents >= other.cents;\n }\n\n /**\n * Check if less than or equal\n */\n lessThanOrEqual(other: IMoney): boolean {\n this.assertSameCurrency(other);\n return this.cents <= other.cents;\n }\n\n /**\n * Check if zero\n */\n isZero(): boolean {\n return this.cents === 0;\n }\n\n /**\n * Check if positive\n */\n isPositive(): boolean {\n return this.cents > 0;\n }\n\n /**\n * Check if negative\n */\n isNegative(): boolean {\n return this.cents < 0;\n }\n\n /**\n * Get absolute value\n */\n abs(): Money {\n return new Money(Math.abs(this.cents), this.currency);\n }\n\n /**\n * Negate the value\n */\n negate(): Money {\n return new Money(-this.cents, this.currency);\n }\n\n /**\n * Convert to JSON-serializable object\n */\n toJSON(): { cents: number; currency: string } {\n return {\n cents: this.cents,\n currency: this.currency.code,\n };\n }\n\n /**\n * String representation\n */\n toString(): string {\n return this.format();\n }\n\n private formatInteger(intStr: string): string {\n const parts: string[] = [];\n let remaining = intStr;\n\n while (remaining.length > 3) {\n parts.unshift(remaining.slice(-3));\n remaining = remaining.slice(0, -3);\n }\n\n if (remaining) {\n parts.unshift(remaining);\n }\n\n return parts.join(this.currency.thousandsSeparator);\n }\n\n private assertSameCurrency(other: IMoney): void {\n if (this.currency.code !== other.currency.code) {\n throw new Error(\n `Cannot perform operation with different currencies: ${this.currency.code} and ${other.currency.code}`\n );\n }\n }\n}\n","import type { Currency } from '../core/types.js';\n\n/**\n * Colombian Peso (COP)\n * Format: $ 1.000,00\n */\nexport const COP: Currency = {\n code: 'COP',\n symbol: '$',\n decimals: 2,\n thousandsSeparator: '.',\n decimalSeparator: ',',\n symbolPosition: 'before',\n symbolSpacing: true,\n};\n\n/**\n * Colombian Peso without decimals (common usage)\n * Format: $ 1.000\n */\nexport const COP_NO_DECIMALS: Currency = {\n ...COP,\n decimals: 0,\n};\n","import type { Currency } from '../core/types.js';\n\n/**\n * Mexican Peso (MXN)\n * Format: $1,000.00\n */\nexport const MXN: Currency = {\n code: 'MXN',\n symbol: '$',\n decimals: 2,\n thousandsSeparator: ',',\n decimalSeparator: '.',\n symbolPosition: 'before',\n symbolSpacing: false,\n};\n","import type { Currency } from '../core/types.js';\n\n/**\n * Argentine Peso (ARS)\n * Format: $ 1.000,00\n */\nexport const ARS: Currency = {\n code: 'ARS',\n symbol: '$',\n decimals: 2,\n thousandsSeparator: '.',\n decimalSeparator: ',',\n symbolPosition: 'before',\n symbolSpacing: true,\n};\n","import type { Currency } from '../core/types.js';\n\n/**\n * Brazilian Real (BRL)\n * Format: R$ 1.000,00\n */\nexport const BRL: Currency = {\n code: 'BRL',\n symbol: 'R$',\n decimals: 2,\n thousandsSeparator: '.',\n decimalSeparator: ',',\n symbolPosition: 'before',\n symbolSpacing: true,\n};\n","import type { Currency } from '../core/types.js';\n\n/**\n * US Dollar (USD)\n * Format: $1,000.00\n */\nexport const USD: Currency = {\n code: 'USD',\n symbol: '$',\n decimals: 2,\n thousandsSeparator: ',',\n decimalSeparator: '.',\n symbolPosition: 'before',\n symbolSpacing: false,\n};\n"]}
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ // src/locales/ar.ts
4
+ var ARS = {
5
+ code: "ARS",
6
+ symbol: "$",
7
+ decimals: 2,
8
+ thousandsSeparator: ".",
9
+ decimalSeparator: ",",
10
+ symbolPosition: "before",
11
+ symbolSpacing: true
12
+ };
13
+
14
+ exports.ARS = ARS;
15
+ //# sourceMappingURL=ar.cjs.map
16
+ //# sourceMappingURL=ar.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/locales/ar.ts"],"names":[],"mappings":";;;AAMO,IAAM,GAAA,GAAgB;AAAA,EAC3B,IAAA,EAAM,KAAA;AAAA,EACN,MAAA,EAAQ,GAAA;AAAA,EACR,QAAA,EAAU,CAAA;AAAA,EACV,kBAAA,EAAoB,GAAA;AAAA,EACpB,gBAAA,EAAkB,GAAA;AAAA,EAClB,cAAA,EAAgB,QAAA;AAAA,EAChB,aAAA,EAAe;AACjB","file":"ar.cjs","sourcesContent":["import type { Currency } from '../core/types.js';\n\n/**\n * Argentine Peso (ARS)\n * Format: $ 1.000,00\n */\nexport const ARS: Currency = {\n code: 'ARS',\n symbol: '$',\n decimals: 2,\n thousandsSeparator: '.',\n decimalSeparator: ',',\n symbolPosition: 'before',\n symbolSpacing: true,\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import { Currency } from '../core/index.cjs';
2
+
3
+ /**
4
+ * Argentine Peso (ARS)
5
+ * Format: $ 1.000,00
6
+ */
7
+ declare const ARS: Currency;
8
+
9
+ export { ARS };
@@ -0,0 +1,9 @@
1
+ import { Currency } from '../core/index.js';
2
+
3
+ /**
4
+ * Argentine Peso (ARS)
5
+ * Format: $ 1.000,00
6
+ */
7
+ declare const ARS: Currency;
8
+
9
+ export { ARS };
@@ -0,0 +1,14 @@
1
+ // src/locales/ar.ts
2
+ var ARS = {
3
+ code: "ARS",
4
+ symbol: "$",
5
+ decimals: 2,
6
+ thousandsSeparator: ".",
7
+ decimalSeparator: ",",
8
+ symbolPosition: "before",
9
+ symbolSpacing: true
10
+ };
11
+
12
+ export { ARS };
13
+ //# sourceMappingURL=ar.js.map
14
+ //# sourceMappingURL=ar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/locales/ar.ts"],"names":[],"mappings":";AAMO,IAAM,GAAA,GAAgB;AAAA,EAC3B,IAAA,EAAM,KAAA;AAAA,EACN,MAAA,EAAQ,GAAA;AAAA,EACR,QAAA,EAAU,CAAA;AAAA,EACV,kBAAA,EAAoB,GAAA;AAAA,EACpB,gBAAA,EAAkB,GAAA;AAAA,EAClB,cAAA,EAAgB,QAAA;AAAA,EAChB,aAAA,EAAe;AACjB","file":"ar.js","sourcesContent":["import type { Currency } from '../core/types.js';\n\n/**\n * Argentine Peso (ARS)\n * Format: $ 1.000,00\n */\nexport const ARS: Currency = {\n code: 'ARS',\n symbol: '$',\n decimals: 2,\n thousandsSeparator: '.',\n decimalSeparator: ',',\n symbolPosition: 'before',\n symbolSpacing: true,\n};\n"]}
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ // src/locales/br.ts
4
+ var BRL = {
5
+ code: "BRL",
6
+ symbol: "R$",
7
+ decimals: 2,
8
+ thousandsSeparator: ".",
9
+ decimalSeparator: ",",
10
+ symbolPosition: "before",
11
+ symbolSpacing: true
12
+ };
13
+
14
+ exports.BRL = BRL;
15
+ //# sourceMappingURL=br.cjs.map
16
+ //# sourceMappingURL=br.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/locales/br.ts"],"names":[],"mappings":";;;AAMO,IAAM,GAAA,GAAgB;AAAA,EAC3B,IAAA,EAAM,KAAA;AAAA,EACN,MAAA,EAAQ,IAAA;AAAA,EACR,QAAA,EAAU,CAAA;AAAA,EACV,kBAAA,EAAoB,GAAA;AAAA,EACpB,gBAAA,EAAkB,GAAA;AAAA,EAClB,cAAA,EAAgB,QAAA;AAAA,EAChB,aAAA,EAAe;AACjB","file":"br.cjs","sourcesContent":["import type { Currency } from '../core/types.js';\n\n/**\n * Brazilian Real (BRL)\n * Format: R$ 1.000,00\n */\nexport const BRL: Currency = {\n code: 'BRL',\n symbol: 'R$',\n decimals: 2,\n thousandsSeparator: '.',\n decimalSeparator: ',',\n symbolPosition: 'before',\n symbolSpacing: true,\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import { Currency } from '../core/index.cjs';
2
+
3
+ /**
4
+ * Brazilian Real (BRL)
5
+ * Format: R$ 1.000,00
6
+ */
7
+ declare const BRL: Currency;
8
+
9
+ export { BRL };
@@ -0,0 +1,9 @@
1
+ import { Currency } from '../core/index.js';
2
+
3
+ /**
4
+ * Brazilian Real (BRL)
5
+ * Format: R$ 1.000,00
6
+ */
7
+ declare const BRL: Currency;
8
+
9
+ export { BRL };
@@ -0,0 +1,14 @@
1
+ // src/locales/br.ts
2
+ var BRL = {
3
+ code: "BRL",
4
+ symbol: "R$",
5
+ decimals: 2,
6
+ thousandsSeparator: ".",
7
+ decimalSeparator: ",",
8
+ symbolPosition: "before",
9
+ symbolSpacing: true
10
+ };
11
+
12
+ export { BRL };
13
+ //# sourceMappingURL=br.js.map
14
+ //# sourceMappingURL=br.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/locales/br.ts"],"names":[],"mappings":";AAMO,IAAM,GAAA,GAAgB;AAAA,EAC3B,IAAA,EAAM,KAAA;AAAA,EACN,MAAA,EAAQ,IAAA;AAAA,EACR,QAAA,EAAU,CAAA;AAAA,EACV,kBAAA,EAAoB,GAAA;AAAA,EACpB,gBAAA,EAAkB,GAAA;AAAA,EAClB,cAAA,EAAgB,QAAA;AAAA,EAChB,aAAA,EAAe;AACjB","file":"br.js","sourcesContent":["import type { Currency } from '../core/types.js';\n\n/**\n * Brazilian Real (BRL)\n * Format: R$ 1.000,00\n */\nexport const BRL: Currency = {\n code: 'BRL',\n symbol: 'R$',\n decimals: 2,\n thousandsSeparator: '.',\n decimalSeparator: ',',\n symbolPosition: 'before',\n symbolSpacing: true,\n};\n"]}
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ // src/locales/co.ts
4
+ var COP = {
5
+ code: "COP",
6
+ symbol: "$",
7
+ decimals: 2,
8
+ thousandsSeparator: ".",
9
+ decimalSeparator: ",",
10
+ symbolPosition: "before",
11
+ symbolSpacing: true
12
+ };
13
+ var COP_NO_DECIMALS = {
14
+ ...COP,
15
+ decimals: 0
16
+ };
17
+
18
+ exports.COP = COP;
19
+ exports.COP_NO_DECIMALS = COP_NO_DECIMALS;
20
+ //# sourceMappingURL=co.cjs.map
21
+ //# sourceMappingURL=co.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/locales/co.ts"],"names":[],"mappings":";;;AAMO,IAAM,GAAA,GAAgB;AAAA,EAC3B,IAAA,EAAM,KAAA;AAAA,EACN,MAAA,EAAQ,GAAA;AAAA,EACR,QAAA,EAAU,CAAA;AAAA,EACV,kBAAA,EAAoB,GAAA;AAAA,EACpB,gBAAA,EAAkB,GAAA;AAAA,EAClB,cAAA,EAAgB,QAAA;AAAA,EAChB,aAAA,EAAe;AACjB;AAMO,IAAM,eAAA,GAA4B;AAAA,EACvC,GAAG,GAAA;AAAA,EACH,QAAA,EAAU;AACZ","file":"co.cjs","sourcesContent":["import type { Currency } from '../core/types.js';\n\n/**\n * Colombian Peso (COP)\n * Format: $ 1.000,00\n */\nexport const COP: Currency = {\n code: 'COP',\n symbol: '$',\n decimals: 2,\n thousandsSeparator: '.',\n decimalSeparator: ',',\n symbolPosition: 'before',\n symbolSpacing: true,\n};\n\n/**\n * Colombian Peso without decimals (common usage)\n * Format: $ 1.000\n */\nexport const COP_NO_DECIMALS: Currency = {\n ...COP,\n decimals: 0,\n};\n"]}
@@ -0,0 +1,14 @@
1
+ import { Currency } from '../core/index.cjs';
2
+
3
+ /**
4
+ * Colombian Peso (COP)
5
+ * Format: $ 1.000,00
6
+ */
7
+ declare const COP: Currency;
8
+ /**
9
+ * Colombian Peso without decimals (common usage)
10
+ * Format: $ 1.000
11
+ */
12
+ declare const COP_NO_DECIMALS: Currency;
13
+
14
+ export { COP, COP_NO_DECIMALS };
@@ -0,0 +1,14 @@
1
+ import { Currency } from '../core/index.js';
2
+
3
+ /**
4
+ * Colombian Peso (COP)
5
+ * Format: $ 1.000,00
6
+ */
7
+ declare const COP: Currency;
8
+ /**
9
+ * Colombian Peso without decimals (common usage)
10
+ * Format: $ 1.000
11
+ */
12
+ declare const COP_NO_DECIMALS: Currency;
13
+
14
+ export { COP, COP_NO_DECIMALS };
@@ -0,0 +1,18 @@
1
+ // src/locales/co.ts
2
+ var COP = {
3
+ code: "COP",
4
+ symbol: "$",
5
+ decimals: 2,
6
+ thousandsSeparator: ".",
7
+ decimalSeparator: ",",
8
+ symbolPosition: "before",
9
+ symbolSpacing: true
10
+ };
11
+ var COP_NO_DECIMALS = {
12
+ ...COP,
13
+ decimals: 0
14
+ };
15
+
16
+ export { COP, COP_NO_DECIMALS };
17
+ //# sourceMappingURL=co.js.map
18
+ //# sourceMappingURL=co.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/locales/co.ts"],"names":[],"mappings":";AAMO,IAAM,GAAA,GAAgB;AAAA,EAC3B,IAAA,EAAM,KAAA;AAAA,EACN,MAAA,EAAQ,GAAA;AAAA,EACR,QAAA,EAAU,CAAA;AAAA,EACV,kBAAA,EAAoB,GAAA;AAAA,EACpB,gBAAA,EAAkB,GAAA;AAAA,EAClB,cAAA,EAAgB,QAAA;AAAA,EAChB,aAAA,EAAe;AACjB;AAMO,IAAM,eAAA,GAA4B;AAAA,EACvC,GAAG,GAAA;AAAA,EACH,QAAA,EAAU;AACZ","file":"co.js","sourcesContent":["import type { Currency } from '../core/types.js';\n\n/**\n * Colombian Peso (COP)\n * Format: $ 1.000,00\n */\nexport const COP: Currency = {\n code: 'COP',\n symbol: '$',\n decimals: 2,\n thousandsSeparator: '.',\n decimalSeparator: ',',\n symbolPosition: 'before',\n symbolSpacing: true,\n};\n\n/**\n * Colombian Peso without decimals (common usage)\n * Format: $ 1.000\n */\nexport const COP_NO_DECIMALS: Currency = {\n ...COP,\n decimals: 0,\n};\n"]}
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ // src/locales/mx.ts
4
+ var MXN = {
5
+ code: "MXN",
6
+ symbol: "$",
7
+ decimals: 2,
8
+ thousandsSeparator: ",",
9
+ decimalSeparator: ".",
10
+ symbolPosition: "before",
11
+ symbolSpacing: false
12
+ };
13
+
14
+ exports.MXN = MXN;
15
+ //# sourceMappingURL=mx.cjs.map
16
+ //# sourceMappingURL=mx.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/locales/mx.ts"],"names":[],"mappings":";;;AAMO,IAAM,GAAA,GAAgB;AAAA,EAC3B,IAAA,EAAM,KAAA;AAAA,EACN,MAAA,EAAQ,GAAA;AAAA,EACR,QAAA,EAAU,CAAA;AAAA,EACV,kBAAA,EAAoB,GAAA;AAAA,EACpB,gBAAA,EAAkB,GAAA;AAAA,EAClB,cAAA,EAAgB,QAAA;AAAA,EAChB,aAAA,EAAe;AACjB","file":"mx.cjs","sourcesContent":["import type { Currency } from '../core/types.js';\n\n/**\n * Mexican Peso (MXN)\n * Format: $1,000.00\n */\nexport const MXN: Currency = {\n code: 'MXN',\n symbol: '$',\n decimals: 2,\n thousandsSeparator: ',',\n decimalSeparator: '.',\n symbolPosition: 'before',\n symbolSpacing: false,\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import { Currency } from '../core/index.cjs';
2
+
3
+ /**
4
+ * Mexican Peso (MXN)
5
+ * Format: $1,000.00
6
+ */
7
+ declare const MXN: Currency;
8
+
9
+ export { MXN };
@@ -0,0 +1,9 @@
1
+ import { Currency } from '../core/index.js';
2
+
3
+ /**
4
+ * Mexican Peso (MXN)
5
+ * Format: $1,000.00
6
+ */
7
+ declare const MXN: Currency;
8
+
9
+ export { MXN };
@@ -0,0 +1,14 @@
1
+ // src/locales/mx.ts
2
+ var MXN = {
3
+ code: "MXN",
4
+ symbol: "$",
5
+ decimals: 2,
6
+ thousandsSeparator: ",",
7
+ decimalSeparator: ".",
8
+ symbolPosition: "before",
9
+ symbolSpacing: false
10
+ };
11
+
12
+ export { MXN };
13
+ //# sourceMappingURL=mx.js.map
14
+ //# sourceMappingURL=mx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/locales/mx.ts"],"names":[],"mappings":";AAMO,IAAM,GAAA,GAAgB;AAAA,EAC3B,IAAA,EAAM,KAAA;AAAA,EACN,MAAA,EAAQ,GAAA;AAAA,EACR,QAAA,EAAU,CAAA;AAAA,EACV,kBAAA,EAAoB,GAAA;AAAA,EACpB,gBAAA,EAAkB,GAAA;AAAA,EAClB,cAAA,EAAgB,QAAA;AAAA,EAChB,aAAA,EAAe;AACjB","file":"mx.js","sourcesContent":["import type { Currency } from '../core/types.js';\n\n/**\n * Mexican Peso (MXN)\n * Format: $1,000.00\n */\nexport const MXN: Currency = {\n code: 'MXN',\n symbol: '$',\n decimals: 2,\n thousandsSeparator: ',',\n decimalSeparator: '.',\n symbolPosition: 'before',\n symbolSpacing: false,\n};\n"]}
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ // src/locales/us.ts
4
+ var USD = {
5
+ code: "USD",
6
+ symbol: "$",
7
+ decimals: 2,
8
+ thousandsSeparator: ",",
9
+ decimalSeparator: ".",
10
+ symbolPosition: "before",
11
+ symbolSpacing: false
12
+ };
13
+
14
+ exports.USD = USD;
15
+ //# sourceMappingURL=us.cjs.map
16
+ //# sourceMappingURL=us.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/locales/us.ts"],"names":[],"mappings":";;;AAMO,IAAM,GAAA,GAAgB;AAAA,EAC3B,IAAA,EAAM,KAAA;AAAA,EACN,MAAA,EAAQ,GAAA;AAAA,EACR,QAAA,EAAU,CAAA;AAAA,EACV,kBAAA,EAAoB,GAAA;AAAA,EACpB,gBAAA,EAAkB,GAAA;AAAA,EAClB,cAAA,EAAgB,QAAA;AAAA,EAChB,aAAA,EAAe;AACjB","file":"us.cjs","sourcesContent":["import type { Currency } from '../core/types.js';\n\n/**\n * US Dollar (USD)\n * Format: $1,000.00\n */\nexport const USD: Currency = {\n code: 'USD',\n symbol: '$',\n decimals: 2,\n thousandsSeparator: ',',\n decimalSeparator: '.',\n symbolPosition: 'before',\n symbolSpacing: false,\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import { Currency } from '../core/index.cjs';
2
+
3
+ /**
4
+ * US Dollar (USD)
5
+ * Format: $1,000.00
6
+ */
7
+ declare const USD: Currency;
8
+
9
+ export { USD };
@@ -0,0 +1,9 @@
1
+ import { Currency } from '../core/index.js';
2
+
3
+ /**
4
+ * US Dollar (USD)
5
+ * Format: $1,000.00
6
+ */
7
+ declare const USD: Currency;
8
+
9
+ export { USD };
@@ -0,0 +1,14 @@
1
+ // src/locales/us.ts
2
+ var USD = {
3
+ code: "USD",
4
+ symbol: "$",
5
+ decimals: 2,
6
+ thousandsSeparator: ",",
7
+ decimalSeparator: ".",
8
+ symbolPosition: "before",
9
+ symbolSpacing: false
10
+ };
11
+
12
+ export { USD };
13
+ //# sourceMappingURL=us.js.map
14
+ //# sourceMappingURL=us.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/locales/us.ts"],"names":[],"mappings":";AAMO,IAAM,GAAA,GAAgB;AAAA,EAC3B,IAAA,EAAM,KAAA;AAAA,EACN,MAAA,EAAQ,GAAA;AAAA,EACR,QAAA,EAAU,CAAA;AAAA,EACV,kBAAA,EAAoB,GAAA;AAAA,EACpB,gBAAA,EAAkB,GAAA;AAAA,EAClB,cAAA,EAAgB,QAAA;AAAA,EAChB,aAAA,EAAe;AACjB","file":"us.js","sourcesContent":["import type { Currency } from '../core/types.js';\n\n/**\n * US Dollar (USD)\n * Format: $1,000.00\n */\nexport const USD: Currency = {\n code: 'USD',\n symbol: '$',\n decimals: 2,\n thousandsSeparator: ',',\n decimalSeparator: '.',\n symbolPosition: 'before',\n symbolSpacing: false,\n};\n"]}
package/package.json ADDED
@@ -0,0 +1,135 @@
1
+ {
2
+ "name": "soff-money",
3
+ "version": "0.1.0",
4
+ "description": "Safe money handling for JavaScript with integer-based arithmetic and LATAM locale formatting",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "sideEffects": false,
10
+ "exports": {
11
+ ".": {
12
+ "import": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "require": {
17
+ "types": "./dist/index.d.cts",
18
+ "default": "./dist/index.cjs"
19
+ }
20
+ },
21
+ "./core": {
22
+ "import": {
23
+ "types": "./dist/core/index.d.ts",
24
+ "default": "./dist/core/index.js"
25
+ },
26
+ "require": {
27
+ "types": "./dist/core/index.d.cts",
28
+ "default": "./dist/core/index.cjs"
29
+ }
30
+ },
31
+ "./locales/co": {
32
+ "import": {
33
+ "types": "./dist/locales/co.d.ts",
34
+ "default": "./dist/locales/co.js"
35
+ },
36
+ "require": {
37
+ "types": "./dist/locales/co.d.cts",
38
+ "default": "./dist/locales/co.cjs"
39
+ }
40
+ },
41
+ "./locales/mx": {
42
+ "import": {
43
+ "types": "./dist/locales/mx.d.ts",
44
+ "default": "./dist/locales/mx.js"
45
+ },
46
+ "require": {
47
+ "types": "./dist/locales/mx.d.cts",
48
+ "default": "./dist/locales/mx.cjs"
49
+ }
50
+ },
51
+ "./locales/ar": {
52
+ "import": {
53
+ "types": "./dist/locales/ar.d.ts",
54
+ "default": "./dist/locales/ar.js"
55
+ },
56
+ "require": {
57
+ "types": "./dist/locales/ar.d.cts",
58
+ "default": "./dist/locales/ar.cjs"
59
+ }
60
+ },
61
+ "./locales/br": {
62
+ "import": {
63
+ "types": "./dist/locales/br.d.ts",
64
+ "default": "./dist/locales/br.js"
65
+ },
66
+ "require": {
67
+ "types": "./dist/locales/br.d.cts",
68
+ "default": "./dist/locales/br.cjs"
69
+ }
70
+ },
71
+ "./locales/us": {
72
+ "import": {
73
+ "types": "./dist/locales/us.d.ts",
74
+ "default": "./dist/locales/us.js"
75
+ },
76
+ "require": {
77
+ "types": "./dist/locales/us.d.cts",
78
+ "default": "./dist/locales/us.cjs"
79
+ }
80
+ }
81
+ },
82
+ "files": [
83
+ "dist"
84
+ ],
85
+ "scripts": {
86
+ "build": "tsup",
87
+ "dev": "tsup --watch",
88
+ "test": "vitest run",
89
+ "test:watch": "vitest",
90
+ "test:coverage": "vitest --coverage",
91
+ "type-check": "tsc --noEmit",
92
+ "lint": "eslint .",
93
+ "lint:fix": "eslint . --fix",
94
+ "clean": "rimraf dist coverage .turbo"
95
+ },
96
+ "keywords": [
97
+ "money",
98
+ "currency",
99
+ "dinero",
100
+ "typescript",
101
+ "tree-shaking",
102
+ "latam",
103
+ "safe-money",
104
+ "integer-arithmetic",
105
+ "formatting",
106
+ "lightweight"
107
+ ],
108
+ "author": "Luis C. Rojas",
109
+ "license": "MIT",
110
+ "repository": {
111
+ "type": "git",
112
+ "url": "git+https://github.com/bledxs/soff-monorepo.git",
113
+ "directory": "packages/soff-money"
114
+ },
115
+ "bugs": {
116
+ "url": "https://github.com/bledxs/soff-monorepo/issues"
117
+ },
118
+ "homepage": "https://github.com/bledxs/soff-monorepo/tree/main/packages/soff-money#readme",
119
+ "engines": {
120
+ "node": ">=20"
121
+ },
122
+ "devDependencies": {
123
+ "@eslint/js": "^9.39.1",
124
+ "@soff/tsconfig": "*",
125
+ "@vitest/coverage-v8": "^4.0.14",
126
+ "eslint": "^9.39.1",
127
+ "eslint-config-prettier": "^10.1.8",
128
+ "globals": "^16.5.0",
129
+ "rimraf": "^6.0.1",
130
+ "tsup": "^8.5.1",
131
+ "typescript": "^5.9.3",
132
+ "typescript-eslint": "^8.48.0",
133
+ "vitest": "^4.0.14"
134
+ }
135
+ }