Skip to content

Commit

Permalink
Merge pull request #119 from didi/bugfix
Browse files Browse the repository at this point in the history
Bugfix
  • Loading branch information
sky-admin authored May 5, 2019
2 parents 2072631 + 9680996 commit 37c0ae5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ module.exports = {
'swan': false,
'Component': false,
'Page': false,
'App': false
'App': false,
'__mpx_mode__': false,
'getRegExp': false
},
rules: {
'no-cond-assign': 0
'no-cond-assign': 0,
"camelcase": ['error', {'allow': ['__mpx_mode__', '__swan_exports_map__']}]
}
}
7 changes: 3 additions & 4 deletions packages/webpack-plugin/lib/runtime/injectHelper.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,20 @@ function concat (a, b) {
return a ? b ? (a + ' ' + b) : a : (b || '')
}


function isObject (obj) {
return obj !== null && typeof obj === 'object'
}

function likeArray (arr) {
return arr.constructor === 'Array'
return arr && arr.constructor === 'Array'
}

function isDef (v) {
return v !== undefined && v !== null
}

function stringifyClass (value) {
if (value === undefined) return ''
if (!value) return ''
if (likeArray(value)) {
return stringifyArray(value)
}
Expand Down Expand Up @@ -179,7 +178,7 @@ function mergeObjectArray (arr) {
}

function normalizeDynamicStyle (value) {
if (value === undefined) return {}
if (!value) return {}
if (likeArray(value)) {
return mergeObjectArray(value)
}
Expand Down

0 comments on commit 37c0ae5

Please sign in to comment.