use array destructuring approach
This commit is contained in:
@@ -51,8 +51,7 @@ export const mutations = {
|
|||||||
if(setting == null || !(setting instanceof Array) || setting.length !== 2)
|
if(setting == null || !(setting instanceof Array) || setting.length !== 2)
|
||||||
throw new Error("You must provide a setting (array in the form [key, value])");
|
throw new Error("You must provide a setting (array in the form [key, value])");
|
||||||
|
|
||||||
let key = setting[0];
|
const [key, value] = setting;
|
||||||
let value = setting[1];
|
|
||||||
// Do not just remove this check.
|
// Do not just remove this check.
|
||||||
// Add your settings key to the SETTINGS_KEYS array at the
|
// Add your settings key to the SETTINGS_KEYS array at the
|
||||||
// top of the file.
|
// top of the file.
|
||||||
|
|||||||
Reference in New Issue
Block a user