From c4b40bcb08ad2e6ad820ec5b1e6880594d2ddaa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 29 Jun 2018 20:01:44 +0800 Subject: [PATCH] update --- History.md | 2 +- lib/number.js | 3 +++ package.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) 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",