Skip to main content

getSanitizedTasks()

function getSanitizedTasks(tasks: Task[]): TaskWithSanitizedContent[]

Takes an array of tasks and returns a new array with sanitized content added as 'sanitizedContent' property to each task.

Parameters

ParameterTypeDescription
tasksTask[]Array of Task objects to sanitize

Returns

TaskWithSanitizedContent[]

Array of tasks with added sanitizedContent property

See

getSanitizedContent

Example

const tasks = [{ content: '**Bold** task', ... }]
getSanitizedTasks(tasks) // [{ content: '**Bold** task', sanitizedContent: 'Bold task', ... }]