Skip to main content
Enumerable(value): (target, key) => void
Defined in: packages/http-framework/src/lib/decorators/Enumerable.ts:24 Decorator that sets the enumerable property of a class field to the given value.

Parameters

value

boolean Whether the property should be enumerable or not.

Returns

A property decorator. (target, key) => void

Remarks

The decorator installs a setter on the prototype, which is bypassed by the Object.defineProperty call that useDefineForClassFields (enabled by @sapphire/ts-config, and the default from ES2022 onwards) emits for class fields. Mark the field as declare so no field definition is emitted, and assign it in the constructor.

Example