function scopeTable
scopeTable(
entries: readonly ScopeEntry[],
width: number
): string

A scope as a human reads it: one name per line, its value beside it, where it came from after.

import { scopeTable } from './scope.ts';

scopeTable([{ name: 'label', value: "'one'", where: 'line 1' }], 80);
// "label  'one'  line 1"
scopeTable([], 80); // '' — the caller says what nothing means, since the two commands differ

Parameters

entries: readonly ScopeEntry[]
width: number

Return Type

string

Usage

import { scopeTable } from "lib/repl/scope.ts";