UNPKG

money-ts

Version:

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

9 lines 570 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var io_ts_1 = require("io-ts"); var Dense_1 = require("../Dense"); var Rational_1 = require("./Rational"); exports.getDense = function (dimension) { return new io_ts_1.Type('Dense', function (m) { return m instanceof Dense_1.Dense && m.dimension === dimension; }, function (m, c) { return Rational_1.Rational.validate(m, c).map(function (r) { return new Dense_1.Dense(dimension, r); }); }, function (a) { return Rational_1.Rational.encode(a.value); }); }; //# sourceMappingURL=Dense.js.map