taghelper
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i taghelper

Weekly Downloads

17

Version

1.0.3

License

MIT

Last publish

Collaborators

  • aliceklipper