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
Currently, Set is defined via multiple: true, and Map (when we think of object with each property of same type) via _desciptorPrototype_.setProperties({ type: Object, nested: true }).
It doesn't seem intuitive, and probably can be improved, by removing both multiple: true and descriptorPrototype functions, and instead introducing aside of type meta property, an itemType property
Additionally for object kind of itemType's we may introduce (optional) itemPrototype property, which will allow to customise type provided for itemType without a need to create such type as standalone one. That thing is not possible in current implementation of dbjs (all we have is _descriptorPrototype_)
The text was updated successfully, but these errors were encountered:
Map (generic object type, in current version represented by Object). Keys accept any values, Values accept any values and null. Aside provide built-in support for keyType and itemType through which keys and/or values can be restricted to specific type
Set - Map extension, with values restricted to null type
Object - Map extension with keys restricted to String type
Having that all multiple properties, will be reflected with property of Set type, in most cases additionally restricted through keyType (so e.g. to have list of strings, we'd need Set with keyType set to String)
/cc @kamsi @mtuchowski
Currently, Set is defined via
multiple: true
, and Map (when we think of object with each property of same type) via_desciptorPrototype_.setProperties({ type: Object, nested: true })
.It doesn't seem intuitive, and probably can be improved, by removing both
multiple: true
and descriptorPrototype functions, and instead introducing aside oftype
meta property, anitemType
propertySo sets can be defined as:
and maps as e.g.:
Additionally for object kind of
itemType
's we may introduce (optional)itemPrototype
property, which will allow to customise type provided foritemType
without a need to create such type as standalone one. That thing is not possible in current implementation of dbjs (all we have is_descriptorPrototype_
)The text was updated successfully, but these errors were encountered: