function remove(hookId) {
    let [id,label] = hookId.split(".");
    if ( !label) {
        throw new Error("Cannot remove hook without label: "+hookId)
    }
    Log.debug(`Removing hook '${hookId}'`);
    if (labelledHooks[label]) {
        if (id === "*") {
            // Remove all hooks for this label
            let hookList = Object.keys(labelledHooks[label]);
            for (let i=0;i<hookList.length;i++) {
                removeHook(hookList[i],labelledHooks[label][hookList[i]])
            }
            delete labelledHooks[label];
        } else if (labelledHooks[label][id]) {
            removeHook(id,labelledHooks[label][id])
            delete labelledHooks[label][id];
            if (Object.keys(labelledHooks[label]).length === 0){
                delete labelledHooks[label];
            }
        }
    }
}
Remove a handled from a named hook
@memberof @node-red/util_hooks
@param {String} hookId - the name of the hook event to remove - must be `name.label`