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

fix: allow undefined value for all fields #114

Merged
merged 1 commit into from
Feb 12, 2021

Conversation

wschurman
Copy link
Member

Why

Similar to how null is blanket allowed as a field value, undefined should have similar behavior for "unsetting" a mutator setField call.

For example, some code like:

mutator.setField('key', 3);
if (condition) {
  // unset the field
  mutator.setField('key', undefined);
}

How

Allow undefined in the base class field validation method in the same way null is allowed.

Test Plan

Run tests.

@wschurman wschurman merged commit 022e0e9 into master Feb 12, 2021
@wschurman wschurman deleted the @wschurman/fix-undefined-field-setting branch February 12, 2021 17:34
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