pull down to refresh
Mhh, matchAll is literally only used here but I think the default is not applied because we explicitly pass null as the argument:
matchAll
null
lib/item.js:
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)
api/resolvers/item.js:
if (hasDeleteCommand(old.text)) { // delete any deletion jobs that were created from a prior version of the item await clearDeletionJobs(item, models) }
PR up
Thank you 🙏
No worries :)
Mhh,
matchAllis literally only used here but I think the default is not applied because we explicitly passnullas the argument:lib/item.js:
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)api/resolvers/item.js:
if (hasDeleteCommand(old.text)) { // delete any deletion jobs that were created from a prior version of the item await clearDeletionJobs(item, models) }