Skip to the content

Tane種

Reproduce numbers from a seed, shuffle or pick items, share a daily puzzle and resume a saved stream.

Tane means seed in Japanese. About the name

Contents

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

NameTypeDescription
templatestring

Text containing named braces to fill.

valuesRecord<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 42

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/tane 1.3.0.