money-ts
Version:
TypeScript library for type-safe and lossless encoding and manipulation of world currencies and precious metals
12 lines • 603 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var io_ts_1 = require("io-ts");
var NonZeroInteger_1 = require("./NonZeroInteger");
var Natural_1 = require("./Natural");
var NonZeroRational_1 = require("../NonZeroRational");
var NZR = io_ts_1.tuple([NonZeroInteger_1.NonZeroInteger, Natural_1.Natural]);
exports.NonZeroRational = new io_ts_1.Type('NonZeroRational', NZR.is, function (m, c) { return NZR.validate(m, c).map(function (_a) {
var n = _a[0], d = _a[1];
return NonZeroRational_1.reduce(n, d);
}); }, NZR.encode);
//# sourceMappingURL=NonZeroRational.js.map