Reference · Cube engine and views
fillfunction
A line of a table with its braces filled in: fill("A {n}×{n} cube", { n: 3 }) is "A 3×3 cube". A brace with nothing to fill it is left as it is.
Import it
import { fill } from "@johnmorrisdotca/kyuubu";
Definition
function fill(text: string, values?: Readonly<Record<string, string | number>>): string
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The text to parse or format. |
values (optional) | Readonly<Record<string, string | number>> | Replacement values keyed by the braces in the text. |
Returns
string
A line of a table with its braces filled in: fill("A {n}×{n} cube", { n: 3 }) is "A 3×3 cube". A brace with nothing to fill it is left as it is.
Examples
import { fill } from "@johnmorrisdotca/kyuubu";
console.log(fill("A {n}×{n} cube", { n: 3 }));A 3×3 cubeWhat it prints (run when this page was built)