UNPKG

money-ts

Version:

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

12 lines 525 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var io_ts_1 = require("io-ts"); var Integer_1 = require("./Integer"); var Natural_1 = require("./Natural"); var Rational_1 = require("../Rational"); var R = io_ts_1.tuple([Integer_1.Integer, Natural_1.Natural]); exports.Rational = new io_ts_1.Type('Rational', R.is, function (m, c) { return R.validate(m, c).map(function (_a) { var n = _a[0], d = _a[1]; return Rational_1.reduce(n, d); }); }, R.encode); //# sourceMappingURL=Rational.js.map