From eeaeb295fd606430a8cd9b3692c0a8df0ae76382 Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 23 Jul 2018 10:01:19 +0200 Subject: follow linter presets --- src/index.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/index.js b/src/index.js index 8d65e40..c47fb38 100644 --- a/src/index.js +++ b/src/index.js @@ -20,11 +20,10 @@ function parse(value, indexNext, userConfig) { let letsEat = ''; let stopOnBrace = false; let errorDetected = false; - let config = {...defaultConfig, ...userConfig}; - + const config = {...defaultConfig, ...userConfig}; // Make defaultValue a function if it isn't - if( typeof(config.defaultValue) != "function" ) { + if (typeof (config.defaultValue) !== 'function') { const {defaultValue} = config; config.defaultValue = () => defaultValue; } @@ -162,11 +161,11 @@ function parse(value, indexNext, userConfig) { return nothingHappend; } if (labelFirst !== 'id' && labelFirst !== 'class') { - if( labelSecond != undefined ) { - prop[labelFirst] = labelSecond; - } else { // Here, we have a attribute without value + if (labelSecond === undefined) { // Here, we have a attribute without value // so it's user defined prop[labelFirst] = config.defaultValue(labelFirst); + } else { + prop[labelFirst] = labelSecond; } } break; -- cgit v1.2.3