Skip to content

Commit

Permalink
fix(cli): 引入json包含null的问题,close #3505
Browse files Browse the repository at this point in the history
  • Loading branch information
creasy2010 authored and luckyadam committed Jun 21, 2019
1 parent b9f708a commit 849999d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/taro-cli/src/util/astConvert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export function convertObjectToAstExpression (obj: object): t.ObjectProperty[] {
if (Array.isArray(value)) {
return t.objectProperty(t.stringLiteral(key), t.arrayExpression(convertArrayToAstExpression(value as [])))
}
if (value === null) {
return t.objectProperty(t.stringLiteral(key), t.nullLiteral())
}
if (typeof value === 'object') {
return t.objectProperty(t.stringLiteral(key), t.objectExpression(convertObjectToAstExpression(value)))
}
Expand Down

0 comments on commit 849999d

Please sign in to comment.