import { isForbiddenPropertyName } from '@msinternal/botframework-webchat-base/utils'; export default function deleteKey(map: TMap, ...keys: TKey[]): Omit { if (!map) { return map; } const nextMap = { ...map }; for (const key of keys) { if (typeof key !== 'string' || !isForbiddenPropertyName(key)) { // Mitigation through denylisting. // eslint-disable-next-line security/detect-object-injection delete nextMap[key]; } } return nextMap; }