Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
boris-chernysh opened this issue Dec 3, 2020 · 0 comments
Open

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

boris-chernysh opened this issue Dec 3, 2020 · 0 comments

Comments

@boris-chernysh
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant