0
2
MBMichael Born
The code defines a field named "defaultIncludes" and a field named "defaults" in the instance of the Memento class. The "defaultIncludes" field contains an array of strings which are automatically included in every getMemento() call on the instance. The "defaults" field contains an object which can be used to override the default values for the "name" and "description" fields.
Library: Mementifier
Shortcut: memento
this.memento = {
// An array of the properties/relationships to include by default
defaultIncludes =
[
"id",
"name",
"isPrimary"
],
// An array of properties/relationships to exclude by default
defaultExcludes = [],
// An array of properties/relationships to NEVER include
neverInclude = [],
// A struct of defaults for properties/relationships if they are null
defaults = {
"name" : "",
"isPrimary" : false
},
// A struct of mapping functions for properties/relationships that can transform them
mappers = {}
};