You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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. Namelyundefined
,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 whatobject.keys(schema)
does.The text was updated successfully, but these errors were encountered: