From 09b11fd3e6bee1e8abc9b679755cfea862c207b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 17 Mar 2017 20:12:45 +0800 Subject: [PATCH] Optimise String extend function. --- History.md | 4 ++++ lib/string.js | 4 ++-- package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/History.md b/History.md index 9ccf8e4..cd0b434 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,7 @@ +0.0.3 / 2017-03-17 +================== + * Optimise String extend function. + 0.0.1 / 2017-02-28 ================== * Initial release \ No newline at end of file diff --git a/lib/string.js b/lib/string.js index 0aef816..6827117 100644 --- a/lib/string.js +++ b/lib/string.js @@ -36,8 +36,8 @@ if(!String.prototype.splice){ }else{ len -= 0; - let strl = this.slice(0, start) - let strr = this.slice(start + len) + let strl = this.slice(0, start), + strr = this.slice(start + len); return strl + fill + strr } diff --git a/package.json b/package.json index bd737ef..4f8f6ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "es.shim", - "version": "0.0.2", + "version": "0.0.3", "description": "Some shim api that let you can use in all node.js environment", "keyworks": [ "es5",