matchAll
null
export const getDeleteCommand = (text = '') => { const matches = [...text.matchAll(deletePattern)] const commands = matches?.map(match => ({ number: match[1], unit: match[2] })) return commands.length ? commands[commands.length - 1] : undefined } export const hasDeleteCommand = (text) => !!getDeleteCommand(text)
if (hasDeleteCommand(old.text)) { // delete any deletion jobs that were created from a prior version of the item await clearDeletionJobs(item, models) }
matchAll
is literally only used here but I think the default is not applied because we explicitly passnull
as the argument: