diff options
author | ache <ache@ache.one> | 2018-07-23 10:01:19 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2018-07-23 10:02:22 +0200 |
commit | eeaeb295fd606430a8cd9b3692c0a8df0ae76382 (patch) | |
tree | 10ae9d53e86a2e663fc102b0054ee3002a0856d4 /src/index.js | |
parent | babel support for spread syntax (diff) |
follow linter presets
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 11 |
1 files changed, 5 insertions, 6 deletions
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; |