Skip to content

Add an object.append() method #1381

@kanongil

Description

@kanongil

While the object.keys(schema) method allows an existing schema to be extended, the behaviour when no keys are present does not align with what I expect. Namely undefined, null, & {} does not extend the existing schema, but for some reason replaces it.

This means that if I want to optionally extend a schema, I will need to manually test the extension for these values, to avoid calling object.keys() with it.

As such, I would like to propose an object.append(schema) method, which will do nothing for these values, and otherwise do what object.keys(schema) does.

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions