interface ScopeEntry

One thing in scope: what it is called, what it holds, and where it came from.

value is already rendered — by the same renderer the prompt prints values with, so a string in a scope listing is quoted and coloured exactly as it would be if you had typed its name.

const entry: ScopeEntry = { name: 'label', value: "'one'", where: 'line 1' };
entry.where; // 'line 1' — the input that declared it, or the file it was preloaded from

Properties

name: string

The name it is bound to.

value: string

The rendered value, coloured when the terminal takes colour.

where: string

Where it came from, or '' where nothing knows.

Usage

import { type ScopeEntry } from "lib/repl/session.ts";