From 82e379ee7f8073c826d61f1529d26787b45d0485 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 25 Apr 2017 12:03:09 +0300 Subject: [PATCH] refactor(input) clone -> Object.assign --- client/input.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/client/input.js b/client/input.js index ab88871a..b6de04ea 100644 --- a/client/input.js +++ b/client/input.js @@ -26,7 +26,7 @@ module.exports.getName = (element) => { }; module.exports.convert = (config) => { - const result = clone(config); + const result = Object.assign({}, config); const array = Object.keys(result); array @@ -40,16 +40,6 @@ module.exports.convert = (config) => { return result; }; -function clone(object) { - const result = {}; - - Object.keys(object).forEach((name) => { - result[name] = object[name]; - }); - - return result; -} - function setState(state) { if (state) return ' checked';