Skip to content

Helper functions for creating template literal tags.

License

Notifications You must be signed in to change notification settings

klippersubs/taghelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

taghelper

Helper functions for creating template literal tags.

Install

npm install --save taghelper

API

merge

Merges template strings and values arrays into one.

Arguments:

  1. strings : TemplateStringsArray — template strings.
  2. rest : any[] — template values.
  3. options : IMergeOptions = {} — options.

Returns: any[] — two arrays merged into one.

join

Joins both template strings and values into one string.

Arguments:

  1. strings : TemplateStringsArray — template strings.
  2. rest : any[] — template values.
  3. options : IMergeOptions = {} — options for merge 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:

  1. strings : TemplateStringsArray — template strings.
  2. rest : any[] — template values.

Returns: boolean.

IMergeOptions

  • stringify : boolean = false — if true, template values will be converted to strings.
  • raw : boolean = false — if true, raw values of strings will be used.

License

MIT

About

Helper functions for creating template literal tags.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published