getExtendsStack

Type:Function
Status:beta
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.class

This function take a class as parameter and return an array of all the class names used to extends this one…

Params

  1. cls*-Class

    The class to get the stack of

  2. settings{}TGetExtendsStackSettings

    Some settings to configure your process

Return

  1. -Object

    An object of all the parent classes

Example

import { getExtendsStack } from '@blackbyte/sugar/class';
class Coco extends Error {}
class Plop extends Coco {}
getExtendsStack(Plop); // => {Coco: [class ...], Error: [class ...]};

Settings

  1. includeBaseClassfalseBoolean

    Specify if you want to include the base class in the stack or not

Todo

  • testsnormal