diff --git a/lib/core/typed.js b/lib/core/typed.js index 4e284d5a4..aa988f32f 100644 --- a/lib/core/typed.js +++ b/lib/core/typed.js @@ -111,7 +111,7 @@ exports.create = function create(type) { from: 'Fraction', to: 'number', convert: function (x) { - return x.toNumber(); + return x.valueOf(); } } ]; diff --git a/lib/type/fraction/Fraction.js b/lib/type/fraction/Fraction.js index 1afe4cacb..9d8417ccd 100644 --- a/lib/type/fraction/Fraction.js +++ b/lib/type/fraction/Fraction.js @@ -6,15 +6,6 @@ var Fraction = require('fraction.js'); Fraction.prototype.type = 'Fraction'; Fraction.prototype.isFraction = true; -/** - * Get the primitive value of a Fraction, a number - * @return {number} Returns a number - */ -// TODO: remove this when Fraction.js supports this itself. -Fraction.prototype.valueOf = function () { - return this.toNumber(); -}; - /** * Get a JSON representation of a Fraction containing type information * @returns {Object} Returns a JSON object structured as: diff --git a/package.json b/package.json index 2c49b7480..96b6ba7e9 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ ], "dependencies": { "decimal.js": "^4.0.2", - "fraction.js": "^1.7.0", + "fraction.js": "^1.9.0", "tiny-emitter": "^1.0.0", "typed-function": "^0.8.2" },