mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 08:54:10 +00:00
refactor(input) clone -> Object.assign
This commit is contained in:
parent
10307291a3
commit
82e379ee7f
1 changed files with 1 additions and 11 deletions
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue