Options
All
  • Public
  • Public/Protected
  • All
Menu

External module @corpuscule/utils/lib/makeAccessor

This module provides tools to transform property descriptors to accessor descriptors.

Usage

import makeAccessor from '@corpuscule/utils/lib/makeAccessor'

Index

Functions

Functions

makeAccessor

  • makeAccessor(descriptor: PropertyDescriptor & object, initializers: Array<function>): Required<Pick<PropertyDescriptor, "get" | "set">> & Omit<PropertyDescriptor, "get" | "set">
  • Converts the regular property to an accessor and registers the initializer to set the initial value. If the received descriptor already belongs to an accessor, it will be returned as is.

    Parameters

    • descriptor: PropertyDescriptor & object

      a property or an accessor descriptor.

    • initializers: Array<function>

      an array of functions to register the initial value initializer.

    Returns Required<Pick<PropertyDescriptor, "get" | "set">> & Omit<PropertyDescriptor, "get" | "set">

Generated using TypeDoc