UNPKG

@epicallan/money-ts

Version:

TypeScript library for type-safe and lossless encoding and manipulation of world currencies and precious metals

20 lines 859 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getOrd = exports.getEq = exports.compose = exports.exchange = exports.unwrap = exports.wrap = void 0; var PR = require("./PositiveRational"); var function_1 = require("fp-ts/function"); exports.wrap = function_1.unsafeCoerce; exports.unwrap = function_1.unsafeCoerce; var exchange = function (er) { return function (d) { return function_1.unsafeCoerce(d.mul(exports.unwrap(er))); }; }; exports.exchange = exchange; function compose(bc, ab) { return exports.wrap(PR.mul(exports.unwrap(bc), exports.unwrap(ab))); } exports.compose = compose; var getEq = function () { return function_1.unsafeCoerce(PR.Eq); }; exports.getEq = getEq; var getOrd = function () { return function_1.unsafeCoerce(PR.Ord); }; exports.getOrd = getOrd; //# sourceMappingURL=ExchangeRate.js.map