{ } qjs-modules

virtual

Source: quickjs-virtual.c — module export: VirtualProperties

Wraps an arbitrary backing store (array, map, plain object, …) behind a uniform get/set/has/delete property interface — a lightweight virtual proxy.

Constructor

new VirtualProperties(target)   // length 1

Methods

MethodArgsDescription
has(key)1Returns whether key exists in the backing store.
get(key)1Returns the value for key.
set(key, value)2Stores value under key.
delete(key)1Removes key.
keys()0Returns the set of keys.

Static functions

FunctionArgsDescription
array(target)1Creates a VirtualProperties backed by an array.
map(target)1Creates one backed by a Map.
object(target)1Creates one backed by a plain object.
from(target)1Creates one by auto-detecting the backing-store type.