add js-fp3

This commit is contained in:
Oli Sturm
2026-04-24 18:04:54 +01:00
parent e61b4d4c11
commit b1ac745d70
8 changed files with 446 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
/**
* @typedef {Object} Money
* @property {number} amount
*/
/**
* @param {number} amount
* @returns {Money}
*/
export const createMoney = (amount) => ({ amount });
/**
* @param {Money} money
* @returns {string}
*/
export const formatMoney = (money) => money.amount.toFixed(2);