MethodEntry

View source

Entry that wraps one function registered as runtime behavior for a TypeEntry.

A method entry retains the original function reference. The MethodEntry#call method invokes that function with an optional positional argument list; the wrapper does not add serialization or lookup metadata of its own.

Examples

function add(a, b) {
  return a + b
}

const method = new MethodEntry(add)
method.method === add // true
method.call([2, 3]) // 5

Constructor


constructor(method: Function)

View source

Creates a method entry around a function reference.

Parameters

NameDescriptionDefault
method——

Properties


Methods


call<T extends unknown[]>(args?: [...T[]]): unknown

View source

Calls the stored function with args spread as positional arguments.

Omitting args invokes the function with no arguments. The return value and thrown errors come directly from the stored function.

Type Parameters

T extends unknown[]

Parameters

NameDescriptionDefault
args?——