• Small helper function that adds toJSON and util.custom.inspect methods to a given class based on its getters

    Note: This means that all getters must be pure! (getter that caches after its first invocation is also considered pure in this case)

    Type Parameters

    • T

    Parameters

    • obj: (new (...args: any[]) => T)
        • new (...args): T
        • Parameters

          • Rest...args: any[]

          Returns T

    • Optionalprops: (keyof T)[]
    • Optionalhide: (keyof T)[]

    Returns typeof obj