/**
 * MultiMap add
 * @param records
 * @param index
 * @param handler
 */
export const mmAdd = (records, index, handler) => {
    const handlers = records[index];
    const functionArray = handlers ? handlers : [];
    return functionArray.concat([handler]);
};
/**
 * Concats an item to an array, eliminating any dups, and creating the array if it is null or undefined
 * @param arr
 * @param item
 */
export const concatNoDups = (arr, item) => {
    const itemArray = Array.isArray(item) ? item : [item];
    const newArray = arr ? itemArray.concat(arr) : itemArray;
    return Array.from(new Set(newArray));
};
/**
 * MultiMap remove
 * @param records
 * @param index
 * @param handler
 */
export const mmRemove = (records, index, handler) => {
    const handlers = records[index];
    const functionArray = handlers ? handlers : [];
    return functionArray.filter((func) => func !== handler);
};
export const errorAsString = (err) => { var _a, _b; return (_b = (_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err) !== null && _b !== void 0 ? _b : null; };
export const GLOBAL_CHANNEL = "global";
export const SERVER_CHANNEL = "FSBL.FDC3.Interop.Server";
export const INTENT_RESOLVER_CHANNEL = "FSBL.FDC3.intent.resolver";
export const EMBEDDED_TITLEBAR_INDICATOR_STRING = "(TitleBar)";
export const AnonymousAuthenticationToken = {
    signatureString: "",
    signatureStringType: "unauthenticated",
    meta: {
        name: "Anonymous app",
        appId: "Anonymous appId",
    },
};
//# sourceMappingURL=types.js.map