Assert function with a message that is generated on demand.
The value to be asserted to be true.
Function to generate the error message, should the value be false.
lazyAssert(obj?.foo?.bar, () => `Object is missing foo.bar. Full object: ${JSON.stringify(obj)}`); Copy
lazyAssert(obj?.foo?.bar, () => `Object is missing foo.bar. Full object: ${JSON.stringify(obj)}`);
Assert function with a message that is generated on demand.