Merge keys, ensuring that each key has both a can.new and can.isMember symbol (the above example only provides a new can.new.
Return a new schema.
Note that the primary motivate for this new feature is https://github.com/canjs/can-fixture/issues/175. can-fixture would still need updating to be able to take schemas (it currently only takes queryLogics).
In https://github.com/canjs/can-type/issues/31 @justinbmeyer said he wants the ability to use an existing schema as the basis for creating a new one.
Since schemas look like this:
You can't easily merge schema using simply
Object.assign(a, b)
or{ ...a, ...b }
style coding.This issue proposes to solve the above problem by adding a
Reflect.mergeSchemas(a, b)
method to can-reflect. It could be used like so:This method would:
identity
arrays, if they exist.keys
, ensuring that each key has both acan.new
andcan.isMember
symbol (the above example only provides a newcan.new
.Note that the primary motivate for this new feature is https://github.com/canjs/can-fixture/issues/175. can-fixture would still need updating to be able to take schemas (it currently only takes queryLogics).