Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} = match;
const create = getActions('createMention');
const update = getActions('updateMention');
const remove = getActions('removeMention');
const isActive = isMarkActive({
from: match.range.from,
to: match.range.end,
type: type,
state: getState(),
});
const fn = isActive ? update : create;
const isSplit = isSplitReason(reason);
const isInvalid = isInvalidSplitReason(reason);
const isRemoved = isRemovedReason(reason);
const removeCommand = () => {
setMarkRemoved();
try {
// This might fail when a deletion has taken place.
isInvalid ? remove({ range: match.range }) : noop();
} catch {
// This sometimes fails and it's best to ignore until more is
// known about the impact.
}
};
const createCommand = ({
replacementType = isSplit ? 'partial' : 'full',
id = match.queryText[replacementType],
label = match.matchText[replacementType],