Skip to content

Recurrences is declared as an array and used as an object #122

@boris-chernysh

Description

@boris-chernysh

Hello

Here is the creation of an array in the reccurrences field:

if (par[curr.uid].recurrences === undefined) {
    par[curr.uid].recurrences = new Array();
}

and here filling it with values:

if (typeof curr.recurrenceid.toISOString === 'function') {
    par[curr.uid].recurrences[curr.recurrenceid.toISOString().substring(0,10)] = recurrenceObj;
}

When using this field, the specifics of the array are not used. This is fine for javascript, but would be an error when using this field in typescript.

Error:

src/dependencies/calendars/ICal/utils.ts:87:46 - error TS7015: Element implicitly has an 'any' type because index 
expression is not of type 'number'.

87             const recurrence = event.recurrences?.[dateLookupKey]

The same goes for the exdate field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions