Skip to content
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

Accept readonly arrays in schema options #470

Closed
3 tasks done
dev054 opened this issue Oct 19, 2020 · 2 comments
Closed
3 tasks done

Accept readonly arrays in schema options #470

dev054 opened this issue Oct 19, 2020 · 2 comments
Assignees

Comments

@dev054
Copy link

dev054 commented Oct 19, 2020

Checks before posting an issue

  • I have read all the library's documentation (README, CHANGELOG, MIGRATION and /docs)
  • I understand I am writing to a human being, doing this open source project on his free time
  • I will be involved in my own issue, by answering questions and informing if the issue is resolved

Configuration

  • @ngx-pwa/local-storage version: 10.x
  • Angular version (ng version): 10.x

Description of the issue

Currently the options enum, items and required only support mutable arrays.

How to reproduce the issue

Example of enum:

const themes = ['dark', 'light'] as const;
this.storageMap.get<Theme>('theme', { enum: themes }) 
// The type 'readonly ["dark", "light"]' is 'readonly' and cannot be assigned to the mutable type 'string[]'.
@cyrilletuzi cyrilletuzi added this to the v11 milestone Oct 19, 2020
@cyrilletuzi cyrilletuzi self-assigned this Oct 19, 2020
@cyrilletuzi
Copy link
Owner

Note for myself: check upon TypeScript 4.1 due to microsoft/TypeScript#39258.

@cyrilletuzi
Copy link
Owner

Released in v11.0.0-1.

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

No branches or pull requests

2 participants