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

new keyExists method added to the luaTable #47

Merged
merged 1 commit into from
Oct 24, 2024
Merged

new keyExists method added to the luaTable #47

merged 1 commit into from
Oct 24, 2024

Conversation

kpacha
Copy link
Member

@kpacha kpacha commented Sep 10, 2024

so users can verify if a key exists before trying to access it (and crashing the snippet execution). Example:

		if responseData:keyExists("unexistent")
		then
			custom_error("unexpected key")
		end
		if not responseData:keyExists("bar")
		then
			custom_error("missing required key")
		end

@kpacha kpacha requested a review from taik0 September 10, 2024 22:07
@kpacha kpacha merged commit 70484f5 into master Oct 24, 2024
4 checks passed
@kpacha kpacha deleted the key_exists branch October 24, 2024 12:07
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.

1 participant