Reference · Streams, draws and seeds
fillInfunction
Put values into a string's braces: fillIn("Seed {seed}", { seed: 42 }) is "Seed 42". A brace with no value is left as it is.
Import it
import { fillIn } from "@johnmorrisdotca/tane";
Definition
function fillIn(template: string, values: Record<string, string | number>): string
Parameters
| Name | Type | Description |
|---|---|---|
template | string | Text containing named braces to fill. |
values | Record<string, string | number> | Replacement values keyed by the braces in the template. |
Returns
string
Put values into a string's braces: fillIn("Seed {seed}", { seed: 42 }) is "Seed 42". A brace with no value is left as it is.
Examples
import { fillIn } from "@johnmorrisdotca/tane";
console.log(fillIn("Seed {seed}", { seed: 42 }));Seed 42What it prints (run when this page was built)