Optionalstate: anyAny object whose properties may handle macros.
Optionalkey: stringAny name to check granularly within macros. See hooks.
Optionalon: string = ''Any further macro name specifier; if given, key
itself and with this specifier are checked (i.e: key then key+'_'+on).
Optionalmacros: How macros should be handled, according to their type, in order of precedence:
nullish: macros to be handled here, nullish returned.true: macros to be handled here, nullish returned.falsey: no macros to be handled here, empty '' string returned.string: no macros to be handled here, this hook value's used instead.function: external hasMacros-like function hook, called with
macros(state, key, on, macros), the returned value used as shown here.object: recurses with any value at the given key, with
hasMacros(state, key, on, macros[key]).nullish returned.Either the result of the macros handled elsewhere,
or nullish if macros should be handled here.
hooks
Whether handling macros here; or the result of a given hook to handle it.
Allows macros of the given key to be handled by external named hooks, to replace any part of the functionality here in overall or granular ways.
The macro names checked in this module are found in
hooks.