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

deletePrefix: more detailed test #4

Merged
merged 4 commits into from
Jun 26, 2024
Merged

deletePrefix: more detailed test #4

merged 4 commits into from
Jun 26, 2024

Conversation

haraldschilly
Copy link
Contributor

related to #3

}
this.keys()
.filter((k) => k.startsWith(prefix) && k !== this.recentKey)
.forEach((k) => this.delete(k));

Choose a reason for hiding this comment

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

Add try/catch as mentioned here: #3 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't want to catch the error, when deleting recentKey. If that fails, it's a problem with the implementation itself. The other operations are caught in the delete method and issue a warning.

Choose a reason for hiding this comment

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

Ok

@haraldschilly haraldschilly merged commit 9884a9d into main Jun 26, 2024
2 checks passed
@haraldschilly
Copy link
Contributor Author

ok, I've merged this and will make a new version

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.

2 participants