Browse Source

Update literal helper to return an empty string rather than the string 'undefined' when the value is undefined

pull/3355/head
Andrew Kingston 5 years ago
parent
commit
9b05990418
  1. 3
      packages/string-templates/src/helpers/index.js

3
packages/string-templates/src/helpers/index.js

@ -46,6 +46,9 @@ const HELPERS = [
}),
// adds a note for post-processor
new Helper(HelperFunctionNames.LITERAL, value => {
if (value === undefined) {
return ""
}
const type = typeof value
const outputVal = type === "object" ? JSON.stringify(value) : value
return `{{${LITERAL_MARKER} ${type}-${outputVal}}}`

Loading…
Cancel
Save