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

Make some more of the array types in SkuConfig readonly #843

Merged
merged 4 commits into from
Jun 23, 2023

Conversation

benjervis
Copy link
Contributor

This came up while we were doing the country-selection-ui statification work. In order to be able to pass in an array that has been set up with as const, which you often do so you can use the types elsewhere, the accepting type needs to be readonly.

Readonly fields do accept mutable versions of the value, so this doesn't create a problem for any existing consumers.

@benjervis benjervis requested a review from a team as a code owner June 23, 2023 04:30
@changeset-bot
Copy link

changeset-bot bot commented Jun 23, 2023

🦋 Changeset detected

Latest commit: ef30d4d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sku Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -39,16 +39,16 @@ interface SkuRouteObject {
route: string;
name?: string;
entry?: string;
languages?: string[];
languages?: ReadonlyArray<string>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you prefer the other syntax:

Suggested change
languages?: ReadonlyArray<string>;
languages?: readonly string[];

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was aiming for consistency with the others here so I know where all my readonlys are

@benjervis benjervis merged commit 806112f into master Jun 23, 2023
@benjervis benjervis deleted the fix-sites-type branch June 23, 2023 04:46
@seek-oss-ci seek-oss-ci mentioned this pull request Jun 23, 2023
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

Successfully merging this pull request may close these issues.

3 participants