Class: Context

Hierarchy

  • Context

Constructors

constructor

+ new Context(env: object, opts: NormalizedFullOptions, sync: boolean): Context

Defined in context/context.ts:13

Parameters:

Name Type Default
env object {}
opts NormalizedFullOptions defaultOptions
sync boolean false

Returns: Context

Properties

environments

environments: Scope

Defined in context/context.ts:10


globals

globals: Scope

Defined in context/context.ts:11


opts

opts: NormalizedFullOptions

Defined in context/context.ts:13


Private registers

registers: object

Defined in context/context.ts:9

Type declaration:


Private scopes

scopes: Scope[] = [{}]

Defined in context/context.ts:8


sync

sync: boolean

Defined in context/context.ts:12

Methods

bottom

bottom(): PlainObject | Drop

Defined in context/context.ts:56

Returns: PlainObject | Drop


Private findScope

findScope(key: string): PlainObject | Drop

Defined in context/context.ts:59

Parameters:

Name Type
key string

Returns: PlainObject | Drop


get

get(paths: string[]): object

Defined in context/context.ts:36

Parameters:

Name Type
paths string[]

Returns: object


getAll

getAll(): PlainObject | Drop

Defined in context/context.ts:32

Returns: PlainObject | Drop


getFromScope

getFromScope(scope: object, paths: string[] | string): object

Defined in context/context.ts:40

Parameters:

Name Type
scope object
paths string[] | string

Returns: object


getRegister

getRegister(key: string, defaultValue: object): any

Defined in context/context.ts:20

Parameters:

Name Type Default
key string -
defaultValue object {}

Returns: any


pop

pop(): undefined | PlainObject | Drop

Defined in context/context.ts:53

Returns: undefined | PlainObject | Drop


push

push(ctx: object): number

Defined in context/context.ts:50

Parameters:

Name Type
ctx object

Returns: number


restoreRegister

restoreRegister(keyValues: [string, any][]): void

Defined in context/context.ts:29

Parameters:

Name Type
keyValues [string, any][]

Returns: void


saveRegister

saveRegister(…keys: string[]): [string, any][]

Defined in context/context.ts:26

Parameters:

Name Type
...keys string[]

Returns: [string, any][]


setRegister

setRegister(key: string, value: any): any

Defined in context/context.ts:23

Parameters:

Name Type
key string
value any

Returns: any