diff --git a/History.md b/History.md index 9378c5e..af6b2a1 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,4 @@ -1.1.0 / 2018-06-29 +1.1.1 / 2018-06-29 ================== * add Number.parse diff --git a/lib/number.js b/lib/number.js index a51bad1..cd59cb6 100644 --- a/lib/number.js +++ b/lib/number.js @@ -12,6 +12,9 @@ if (!Number.parse) { Object.defineProperty(Number, 'parse', { value: function(val) { + if (typeof val !== 'number' && typeof val !== 'string') { + return val + } val += '' if (val.startsWith(0) && !val.startsWith('0.')) { return val diff --git a/package.json b/package.json index c418c31..c38136e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "es.shim", - "version": "1.1.0", + "version": "1.1.1", "description": "Some shim api that let you can use in all node.js environment", "keyworks": [ "es5",