Home > rc-js-util > _Debug > conditionalBlock
Convenience method to run multiple asserts if flag set.
Signature:
static conditionalBlock<TKey extends keyof IBuildConstants>(flag: TKey, cb: () => void): boolean;
Parameter | Type | Description |
---|---|---|
flag | TKey | |
cb | () => void |
Returns:
boolean
A boolean value to make linting happy…
Must still be hidden behind _BUILD.DEBUG check for dead code removal.
_BUILD.DEBUG && _Debug.conditionalBlock("SOME_FLAG", () => {
_Debug.assert(someCondition, "someCondition was wrong");
// ...
});