Object
Object helpers and Proxy.
Always available
No import needed. These names are in scope in every file.
Object class
ts
class ObjectObject namespace. Static utilities for object reflection, property inspection, and shallow copying.
Object.keys
ts
static keys(obj: any): Array<string>Return an array of all own enumerable property names of obj. Works on plain objects, class instances, and struct values.
Object.values
ts
static values(obj: any): Array<any>Return an array of all own enumerable property values of obj. Works on plain objects, class instances, and struct values.
Object.entries
ts
static entries(obj: any): Array<[string, any]>Return an array of [key, value] pairs for all own enumerable properties of obj. Works on plain objects, class instances, and struct values.
Object.fromEntries
ts
static fromEntries(entries: Array<any>): anyRecreate an object from an array of key-value pairs.
Object.assign
ts
static assign(target: any, ...sources: Array<any>): anyCopy all own properties from one or more source objects into target. Returns target.
Object.freeze
ts
static freeze(obj: any): anyFreeze obj, preventing all property additions, deletions, and modifications. Returns obj.
Object.seal
ts
static seal(obj: any): anySeal obj, preventing adding or removing properties, but allowing modifications to existing property values. Returns obj.
Object.isFrozen
ts
static isFrozen(obj: any): booleanReturn true if obj is frozen, or if obj is a primitive.
Object.isSealed
ts
static isSealed(obj: any): booleanReturn true if obj is sealed or frozen, or if obj is a primitive.
Object.hasOwn
ts
static hasOwn(obj: any, prop: string): booleanReturn true if obj has prop as an own property.
Proxy class
ts
class ProxyBase class for objects that answer undeclared names with code. Extend it and override the hooks you need. A hook runs only when the name is not declared on the class (declared fields, getters and methods resolve normally and never reach a hook). On a value typed as a Proxy subclass, an undeclared member is accepted and typed any.
Proxy.getProperty
ts
getProperty(name: string): anyRuns for obj.name / obj[name] when name is undeclared.
Proxy.setProperty
ts
setProperty(name: string, value: any): voidRuns for obj.name = value when name is undeclared.
Proxy.callProperty
ts
callProperty(name: string, ...args: Array<any>): anyRuns for obj.name(...args) when name is undeclared.
Proxy.hasProperty
ts
hasProperty(name: string): booleanRuns for name in obj when name is undeclared.
Proxy.deleteProperty
ts
deleteProperty(name: string): booleanRuns for delete obj[name] when name is undeclared.
Other members of Proxy
ts
constructor()Generated from lang/types/builtin_object.d.tks in the ThicketScript repository.