pentf
    Preparing search index...

    Function lazyAssert

    • Assert function with a message that is generated on demand.

      Parameters

      • value: boolean

        The value to be asserted to be true.

      • makeMessage: () => string

        Function to generate the error message, should the value be false.

      Returns void

      lazyAssert(obj?.foo?.bar, () => `Object is missing foo.bar. Full object: ${JSON.stringify(obj)}`);