From 4f9c6ef8c9e950a160f9ca0436cc5a410f84b5f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Mon, 2 Jul 2018 14:47:23 +0800 Subject: [PATCH] update --- lib/number.js | 8 ++++++-- package.json | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/number.js b/lib/number.js index cd59cb6..88a1553 100644 --- a/lib/number.js +++ b/lib/number.js @@ -16,8 +16,12 @@ if (!Number.parse) { return val } val += '' - if (val.startsWith(0) && !val.startsWith('0.')) { - return val + if (val.startsWith('0') && !val.startsWith('0.')) { + if (val === '0') { + return 0 + } else { + return val + } } else { if (isFinite(val)) { if ( diff --git a/package.json b/package.json index c38136e..4cddd23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "es.shim", - "version": "1.1.1", + "version": "1.1.2", "description": "Some shim api that let you can use in all node.js environment", "keyworks": [ "es5",