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

feat(generate): immutable config object #2

Merged
merged 1 commit into from
Oct 17, 2022
Merged

Conversation

niloysikdar
Copy link
Owner

@niloysikdar niloysikdar commented Oct 17, 2022

Use the Object.freeze method to make our config object immutable so that users can't modify the values.

For TypeScript it will throw an error

Cannot assign to 'CLOUDINARY_API_KEY' because it is a read-only property

For JavaScript, the values won't get changed even if we try to reassign them with new values.

Fixes #1

Signed-off-by: Niloy Sikdar niloysikdar30@gmail.com

Use the Object.freeze method to make our config object immutable so that users can't modify the
values

Fixes #1

Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>
@niloysikdar niloysikdar added the hacktoberfest-accepted This PR has been accepted for Hacktoberfest label Oct 17, 2022
@niloysikdar niloysikdar merged commit 21ba82c into main Oct 17, 2022
@niloysikdar niloysikdar deleted the immutable-fix branch October 17, 2022 08:10
github-actions bot pushed a commit that referenced this pull request Oct 17, 2022
# [1.1.0](v1.0.2...v1.1.0) (2022-10-17)

### Features

* **generate:** immutable config object ([#2](#2)) ([21ba82c](21ba82c)), closes [#1](#1)
@github-actions
Copy link

🎉 This PR is included in version 1.1.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted This PR has been accepted for Hacktoberfest released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Immutable config object
1 participant