UNPKG

synctos

Version:

The Syncmaker. A tool to build comprehensive sync functions for Couchbase Sync Gateway.

44 lines (42 loc) 1.04 kB
function() { function isImmutable(doc, oldDoc, value, oldValue) { return doc.dynamicPropertiesAreImmutable; } return { immutableItemsDoc: { channels: { write: 'write' }, typeFilter: function(doc) { return doc._id === 'immutableItemsDoc'; }, propertyValidators: { staticImmutableArrayProp: { type: 'array', immutable: true }, staticImmutableObjectProp: { type: 'object', immutable: true }, staticImmutableHashtableProp: { type: 'hashtable', immutable: true }, dynamicPropertiesAreImmutable: { type: 'boolean' }, dynamicImmutableArrayProp: { type: 'array', immutable: isImmutable }, dynamicImmutableObjectProp: { type: 'object', immutable: isImmutable }, dynamicImmutableHashtableProp: { type: 'hashtable', immutable: isImmutable } } } }; }