Template literal tag function to replace null
and undefined
values with an empty string.
Example
> clean = require('template-clean')
> const word = 'something'
> const nothing = null
> `a word: ${word}. Nothing: ${nothing}`
'a word: something. Nothing: null'
> clean`a word: ${word}. Nothing: ${nothing}`
'a word: something. Nothing: '
Kind: Exported function
Param | Type |
---|---|
strings | Array.<string> |
...expressions | any |
© 2015-17 Lloyd Brookes <[email protected]>. Documented by jsdoc-to-markdown.