Skip to content

NativeJsonInput: treat object fields with undefined value as missing - #893

Merged
sebaciv merged 4 commits into
masterfrom
js-in-undefinied
Jul 30, 2026
Merged

NativeJsonInput: treat object fields with undefined value as missing#893
sebaciv merged 4 commits into
masterfrom
js-in-undefinied

Conversation

@sebaciv

@sebaciv sebaciv commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Resolves #848

@sebaciv sebaciv self-assigned this Jul 3, 2026
Comment on lines +140 to +143
if (dict.contains(name) && !js.isUndefined(dict(name)))
Opt(new NativeJsonFieldInput(name, dict(name), options))
else
Opt.Empty

@Andrzej-Swietek Andrzej-Swietek Jul 30, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

peekField now does redundant lookups in the hit path ? dict.contains(name) then dict(name) in the isUndefined check

override def peekField(name: String): Opt[FieldInput] =
  dict.get(name).filterNot(js.isUndefined).map(new NativeJsonFieldInput(name, _, options)).toOpt

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed to WrappedDictionary.get + more tests

@sebaciv
sebaciv merged commit 188d81d into master Jul 30, 2026
18 of 19 checks passed
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.

NativeJsonInput: treat object fields with undefined value as missing

2 participants