diff --git a/package-lock.json b/package-lock.json index b28c02a..5d34126 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "smart-round", - "version": "3.0.0", + "version": "3.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "smart-round", - "version": "3.0.0", + "version": "3.0.1", "license": "MIT", "dependencies": { "big.js": "7.0.1" diff --git a/package.json b/package.json index 1db524a..8987512 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "smart-round", - "version": "3.0.0", + "version": "3.0.1", "description": "Round big numbers with arbitrary precision", "keywords": [ "big.js", diff --git a/src/index.ts b/src/index.ts index d2556ff..8200564 100644 --- a/src/index.ts +++ b/src/index.ts @@ -32,7 +32,7 @@ const parse = function ({ throw new Error("maxDecimals should be positive"); } if (minDecimals > maxDecimals) { - throw new Error("minDecimals should be larger than maxDecimals"); + throw new Error("minDecimals should not be larger than maxDecimals"); } if (typeof input === "number" && (isNaN(input) || !isFinite(input))) { throw new Error("input should be a valid number"); diff --git a/test/src.index.spec.ts b/test/src.index.spec.ts index 1f94f7f..2bd07a6 100644 --- a/test/src.index.spec.ts +++ b/test/src.index.spec.ts @@ -193,10 +193,10 @@ describe("smartRound", function () { expect(() => rounder("1")).toThrowError("maxDecimals should be positive"); }); - it("should not allow minDecimals smaller than maxDecimals", function () { + it("should not allow maxDecimals smaller than minDecimals", function () { const rounder = smartRound(1, 3, 2); expect(() => rounder("1")).toThrowError( - "minDecimals should be larger than maxDecimals", + "minDecimals should not be larger than maxDecimals", ); });