Reference · Streams, draws and seeds
fromTextfunction
A position from a line toText wrote, with any space around it. Null for anything else, or for a later format.
Import it
import { fromText } from "@johnmorrisdotca/tane";
Definition
function fromText(text: string): StreamPosition | null
Parameters
| Name | Type | Description |
|---|---|---|
text | string | Text to hash, validate or decode. |
Returns
StreamPosition | null
A position from a line toText wrote, with any space around it. null for anything else, or for a later format.
Examples
import { fromText, toText } from "@johnmorrisdotca/tane";
const position = { seed: 42, draws: 3 };
console.log(fromText(toText(position)));{ seed: 42, draws: 3 }What it prints (run when this page was built)