taghelper
v1.0.3
Published
Helper functions for creating template literal tags.
Downloads
57
Readme
taghelper
Helper functions for creating template literal tags.
Install
npm install --save taghelper
API
merge
Merges template strings and values arrays into one.
Arguments:
strings : TemplateStringsArray
— template strings.rest : any[]
— template values.options : IMergeOptions = {}
— options.
Returns: any[]
— two arrays merged into one.
join
Joins both template strings and values into one string.
Arguments:
strings : TemplateStringsArray
— template strings.rest : any[]
— template values.options : IMergeOptions = {}
— options formerge
function. NB:stringify
option is useless here.
Returns: string
— resulting string.
taglike
Returns true
, if it looks like supplied parameters
are template strings and values arrays.
Arguments:
strings : TemplateStringsArray
— template strings.rest : any[]
— template values.
Returns: boolean
.
IMergeOptions
stringify : boolean = false
— iftrue
, template values will be converted to strings.raw : boolean = false
— iftrue
, raw values of strings will be used.
License
MIT