Skip to content

mk-pmb/func2tag-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

func2tag

Convert any string-producing function to a renderer for JS tagged strings.

API

This module exports one function:

func2tag(f)

Return a function that renders a tagged string by inserting into each slot the result of f(a, i, v) where a is the value for the slot, i is the slot index ("slot number", counting from zero), and v is the list (array) or all slot values.

Usage

See test/usage.mjs.

Known issues

  • Needs more/better tests and docs.

 

License

ISC

About

Convert any string-producing function to a renderer for JS tagged strings.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published