Socket
Socket
Sign inDemoInstall

amelisa

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amelisa - npm Package Compare versions

Comparing version 0.1.27 to 0.1.28

424

lib/client/Model.js

@@ -772,9 +772,5 @@ 'use strict';

}, {
key: 'del',
key: 'setDiff',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee12() {
for (var _len4 = arguments.length, path = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
path[_key4] = arguments[_key4];
}
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee12(path, value) {
var _parsePath5, _parsePath6, collectionName, docId, field, doc;

@@ -793,8 +789,8 @@

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.del collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.del docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.del field should be a string');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.setDiff collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.setDiff docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.setDiff field should be a string');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context12.abrupt('return', doc.del(field));
return _context12.abrupt('return', doc.setDiff(field, value));

@@ -809,12 +805,16 @@ case 10:

function del(_x13) {
function setDiff(_x13, _x14) {
return ref.apply(this, arguments);
}
return del;
return setDiff;
}()
}, {
key: 'push',
key: 'del',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee13(path, value) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee13() {
for (var _len4 = arguments.length, path = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
path[_key4] = arguments[_key4];
}
var _parsePath7, _parsePath8, collectionName, docId, field, doc;

@@ -833,8 +833,8 @@

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.push collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.push docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.push field should be a string');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.del collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.del docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.del field should be a string');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context13.abrupt('return', doc.push(field, value));
return _context13.abrupt('return', doc.del(field));

@@ -849,10 +849,10 @@ case 10:

function push(_x14, _x15) {
function del(_x15) {
return ref.apply(this, arguments);
}
return push;
return del;
}()
}, {
key: 'unshift',
key: 'push',
value: function () {

@@ -873,8 +873,8 @@ var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee14(path, value) {

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.unshift collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.unshift docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.unshift field should be a string');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.push collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.push docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.push field should be a string');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context14.abrupt('return', doc.unshift(field, value));
return _context14.abrupt('return', doc.push(field, value));

@@ -889,12 +889,12 @@ case 10:

function unshift(_x16, _x17) {
function push(_x16, _x17) {
return ref.apply(this, arguments);
}
return unshift;
return push;
}()
}, {
key: 'pop',
key: 'unshift',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee15(path) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee15(path, value) {
var _parsePath11, _parsePath12, collectionName, docId, field, doc;

@@ -913,8 +913,8 @@

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.pop collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.pop docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.pop field should be a string');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.unshift collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.unshift docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.unshift field should be a string');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context15.abrupt('return', doc.pop(field));
return _context15.abrupt('return', doc.unshift(field, value));

@@ -929,10 +929,10 @@ case 10:

function pop(_x18) {
function unshift(_x18, _x19) {
return ref.apply(this, arguments);
}
return pop;
return unshift;
}()
}, {
key: 'shift',
key: 'pop',
value: function () {

@@ -953,8 +953,8 @@ var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee16(path) {

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.shift collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.shift docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.shift field should be a string');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.pop collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.pop docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.pop field should be a string');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context16.abrupt('return', doc.shift(field));
return _context16.abrupt('return', doc.pop(field));

@@ -969,12 +969,12 @@ case 10:

function shift(_x19) {
function pop(_x20) {
return ref.apply(this, arguments);
}
return shift;
return pop;
}()
}, {
key: 'insert',
key: 'shift',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee17(path, index, values) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee17(path) {
var _parsePath15, _parsePath16, collectionName, docId, field, doc;

@@ -993,11 +993,10 @@

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.insert collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.insert docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.insert field should be a string');
(0, _invariant2.default)(typeof index === 'number', 'Model.insert index should be a number');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.shift collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.shift docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.shift field should be a string');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context17.abrupt('return', doc.insert(field, index, values));
return _context17.abrupt('return', doc.shift(field));
case 11:
case 10:
case 'end':

@@ -1010,12 +1009,12 @@ return _context17.stop();

function insert(_x20, _x21, _x22) {
function shift(_x21) {
return ref.apply(this, arguments);
}
return insert;
return shift;
}()
}, {
key: 'remove',
key: 'insert',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee18(path, index, howMany) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee18(path, index, values) {
var _parsePath17, _parsePath18, collectionName, docId, field, doc;

@@ -1034,12 +1033,11 @@

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.remove collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.remove docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.remove field should be a string');
(0, _invariant2.default)(typeof index === 'number', 'Model.remove index should be a number');
(0, _invariant2.default)(typeof howMany === 'number', 'Model.remove howMany should be a number');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.insert collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.insert docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.insert field should be a string');
(0, _invariant2.default)(typeof index === 'number', 'Model.insert index should be a number');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context18.abrupt('return', doc.remove(field, index, howMany));
return _context18.abrupt('return', doc.insert(field, index, values));
case 12:
case 11:
case 'end':

@@ -1052,12 +1050,12 @@ return _context18.stop();

function remove(_x23, _x24, _x25) {
function insert(_x22, _x23, _x24) {
return ref.apply(this, arguments);
}
return remove;
return insert;
}()
}, {
key: 'move',
key: 'remove',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee19(path, from, to, howMany) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee19(path, index, howMany) {
var _parsePath19, _parsePath20, collectionName, docId, field, doc;

@@ -1076,13 +1074,12 @@

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.move collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.move docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.move field should be a string');
(0, _invariant2.default)(typeof from === 'number', 'Model.move from should be a number');
(0, _invariant2.default)(typeof to === 'number', 'Model.move to should be a number');
(0, _invariant2.default)(!howMany || typeof howMany === 'number', 'Model.move howMany should be a number');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.remove collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.remove docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.remove field should be a string');
(0, _invariant2.default)(typeof index === 'number', 'Model.remove index should be a number');
(0, _invariant2.default)(typeof howMany === 'number', 'Model.remove howMany should be a number');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context19.abrupt('return', doc.move(field, from, to, howMany));
return _context19.abrupt('return', doc.remove(field, index, howMany));
case 13:
case 12:
case 'end':

@@ -1095,12 +1092,12 @@ return _context19.stop();

function move(_x26, _x27, _x28, _x29) {
function remove(_x25, _x26, _x27) {
return ref.apply(this, arguments);
}
return move;
return remove;
}()
}, {
key: 'swap',
key: 'move',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee20(path, from, to) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee20(path, from, to, howMany) {
var _parsePath21, _parsePath22, collectionName, docId, field, doc;

@@ -1119,12 +1116,13 @@

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.swap collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.swap docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.swap field should be a string');
(0, _invariant2.default)(typeof from === 'number', 'Model.swap from should be a number');
(0, _invariant2.default)(typeof to === 'number', 'Model.swap to should be a number');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.move collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.move docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.move field should be a string');
(0, _invariant2.default)(typeof from === 'number', 'Model.move from should be a number');
(0, _invariant2.default)(typeof to === 'number', 'Model.move to should be a number');
(0, _invariant2.default)(!howMany || typeof howMany === 'number', 'Model.move howMany should be a number');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context20.abrupt('return', doc.swap(field, from, to));
return _context20.abrupt('return', doc.move(field, from, to, howMany));
case 12:
case 13:
case 'end':

@@ -1137,12 +1135,12 @@ return _context20.stop();

function swap(_x30, _x31, _x32) {
function move(_x28, _x29, _x30, _x31) {
return ref.apply(this, arguments);
}
return swap;
return move;
}()
}, {
key: 'arrayDiff',
key: 'swap',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee21(path, value) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee21(path, from, to) {
var _parsePath23, _parsePath24, collectionName, docId, field, doc;

@@ -1161,11 +1159,12 @@

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.arrayDiff collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.arrayDiff docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.arrayDiff field should be a string');
(0, _invariant2.default)(Array.isArray(value), 'Model.arrayDiff value should be a array');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.swap collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.swap docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.swap field should be a string');
(0, _invariant2.default)(typeof from === 'number', 'Model.swap from should be a number');
(0, _invariant2.default)(typeof to === 'number', 'Model.swap to should be a number');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context21.abrupt('return', doc.arrayDiff(field, value));
return _context21.abrupt('return', doc.swap(field, from, to));
case 11:
case 12:
case 'end':

@@ -1178,12 +1177,12 @@ return _context21.stop();

function arrayDiff(_x33, _x34) {
function swap(_x32, _x33, _x34) {
return ref.apply(this, arguments);
}
return arrayDiff;
return swap;
}()
}, {
key: 'invert',
key: 'arrayDiff',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee22(path) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee22(path, value) {
var _parsePath25, _parsePath26, collectionName, docId, field, doc;

@@ -1202,10 +1201,11 @@

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.invert collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.invert docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.invert field should be a string');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.arrayDiff collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.arrayDiff docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.arrayDiff field should be a string');
(0, _invariant2.default)(Array.isArray(value), 'Model.arrayDiff value should be a array');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context22.abrupt('return', doc.invert(field));
return _context22.abrupt('return', doc.arrayDiff(field, value));
case 10:
case 11:
case 'end':

@@ -1218,12 +1218,12 @@ return _context22.stop();

function invert(_x35) {
function arrayDiff(_x35, _x36) {
return ref.apply(this, arguments);
}
return invert;
return arrayDiff;
}()
}, {
key: 'increment',
key: 'invert',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee23(path, value) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee23(path) {
var _parsePath27, _parsePath28, collectionName, docId, field, doc;

@@ -1242,11 +1242,10 @@

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.increment collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.increment docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.increment field should be a string');
(0, _invariant2.default)(value === undefined || typeof value === 'number', 'Model.increment value should be a number');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.invert collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.invert docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.invert field should be a string');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context23.abrupt('return', doc.increment(field, value));
return _context23.abrupt('return', doc.invert(field));
case 11:
case 10:
case 'end':

@@ -1259,12 +1258,12 @@ return _context23.stop();

function increment(_x36, _x37) {
function invert(_x37) {
return ref.apply(this, arguments);
}
return increment;
return invert;
}()
}, {
key: 'stringInsert',
key: 'increment',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee24(path, index, value) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee24(path, value) {
var _parsePath29, _parsePath30, collectionName, docId, field, doc;

@@ -1283,12 +1282,11 @@

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.stringInsert collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.stringInsert docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.stringInsert field should be a string');
(0, _invariant2.default)(typeof index === 'number', 'Model.stringInsert index should be a number');
(0, _invariant2.default)(typeof value === 'string', 'Model.stringInsert value should be a string');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.increment collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.increment docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.increment field should be a string');
(0, _invariant2.default)(value === undefined || typeof value === 'number', 'Model.increment value should be a number');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context24.abrupt('return', doc.stringInsert(field, index, value));
return _context24.abrupt('return', doc.increment(field, value));
case 12:
case 11:
case 'end':

@@ -1301,12 +1299,12 @@ return _context24.stop();

function stringInsert(_x38, _x39, _x40) {
function increment(_x38, _x39) {
return ref.apply(this, arguments);
}
return stringInsert;
return increment;
}()
}, {
key: 'stringRemove',
key: 'stringInsert',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee25(path, index, howMany) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee25(path, index, value) {
var _parsePath31, _parsePath32, collectionName, docId, field, doc;

@@ -1325,10 +1323,10 @@

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.stringRemove collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.stringRemove docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.stringRemove field should be a string');
(0, _invariant2.default)(typeof index === 'number', 'Model.stringRemove index should be a number');
(0, _invariant2.default)(typeof howMany === 'number', 'Model.stringRemove howMany should be a number');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.stringInsert collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.stringInsert docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.stringInsert field should be a string');
(0, _invariant2.default)(typeof index === 'number', 'Model.stringInsert index should be a number');
(0, _invariant2.default)(typeof value === 'string', 'Model.stringInsert value should be a string');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context25.abrupt('return', doc.stringRemove(field, index, howMany));
return _context25.abrupt('return', doc.stringInsert(field, index, value));

@@ -1343,12 +1341,12 @@ case 12:

function stringRemove(_x41, _x42, _x43) {
function stringInsert(_x40, _x41, _x42) {
return ref.apply(this, arguments);
}
return stringRemove;
return stringInsert;
}()
}, {
key: 'stringDiff',
key: 'stringRemove',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee26(path, value) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee26(path, index, howMany) {
var _parsePath33, _parsePath34, collectionName, docId, field, doc;

@@ -1367,11 +1365,12 @@

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.stringDiff collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.stringDiff docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.stringDiff field should be a string');
(0, _invariant2.default)(typeof value === 'string', 'Model.stringDiff value should be a string');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.stringRemove collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.stringRemove docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.stringRemove field should be a string');
(0, _invariant2.default)(typeof index === 'number', 'Model.stringRemove index should be a number');
(0, _invariant2.default)(typeof howMany === 'number', 'Model.stringRemove howMany should be a number');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context26.abrupt('return', doc.stringDiff(field, value));
return _context26.abrupt('return', doc.stringRemove(field, index, howMany));
case 11:
case 12:
case 'end':

@@ -1384,10 +1383,10 @@ return _context26.stop();

function stringDiff(_x44, _x45) {
function stringRemove(_x43, _x44, _x45) {
return ref.apply(this, arguments);
}
return stringDiff;
return stringRemove;
}()
}, {
key: 'rich',
key: 'stringDiff',
value: function () {

@@ -1408,9 +1407,9 @@ var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee27(path, value) {

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.rich collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.rich docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.rich field should be a string');
(0, _invariant2.default)(value && (typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value)) === 'object', 'Model.rich value should be an object');
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.stringDiff collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.stringDiff docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.stringDiff field should be a string');
(0, _invariant2.default)(typeof value === 'string', 'Model.stringDiff value should be a string');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context27.abrupt('return', doc.rich(field, value));
return _context27.abrupt('return', doc.stringDiff(field, value));

@@ -1425,10 +1424,10 @@ case 11:

function rich(_x46, _x47) {
function stringDiff(_x46, _x47) {
return ref.apply(this, arguments);
}
return rich;
return stringDiff;
}()
}, {
key: 'draftDiff',
key: 'rich',
value: function () {

@@ -1449,2 +1448,41 @@ var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee28(path, value) {

(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.rich collectionName is required and should be a string');
(0, _invariant2.default)(docId && typeof docId === 'string', 'Model.rich docId is required and should be a string');
(0, _invariant2.default)(!field || typeof field === 'string', 'Model.rich field should be a string');
(0, _invariant2.default)(value && (typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value)) === 'object', 'Model.rich value should be an object');
doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context28.abrupt('return', doc.rich(field, value));
case 11:
case 'end':
return _context28.stop();
}
}
}, _callee28, this);
}));
function rich(_x48, _x49) {
return ref.apply(this, arguments);
}
return rich;
}()
}, {
key: 'draftDiff',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee29(path, value) {
var _parsePath39, _parsePath40, collectionName, docId, field, doc;
return _regenerator2.default.wrap(function _callee29$(_context29) {
while (1) {
switch (_context29.prev = _context29.next) {
case 0:
_parsePath39 = (0, _util.parsePath)(path);
_parsePath40 = (0, _slicedToArray3.default)(_parsePath39, 3);
collectionName = _parsePath40[0];
docId = _parsePath40[1];
field = _parsePath40[2];
(0, _invariant2.default)(collectionName && typeof collectionName === 'string', 'Model.draftDiff collectionName is required and should be a string');

@@ -1456,13 +1494,13 @@ (0, _invariant2.default)(docId && typeof docId === 'string', 'Model.draftDiff docId is required and should be a string');

doc = this.collectionSet.getOrCreateDoc(collectionName, docId);
return _context28.abrupt('return', doc.draftDiff(field, value));
return _context29.abrupt('return', doc.draftDiff(field, value));
case 11:
case 'end':
return _context28.stop();
return _context29.stop();
}
}
}, _callee28, this);
}, _callee29, this);
}));
function draftDiff(_x48, _x49) {
function draftDiff(_x50, _x51) {
return ref.apply(this, arguments);

@@ -1486,9 +1524,9 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee29(newProjectionHashes) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee30(newProjectionHashes) {
var _this3 = this;
var prevProjectionHashes, collectionNames;
return _regenerator2.default.wrap(function _callee29$(_context29) {
return _regenerator2.default.wrap(function _callee30$(_context30) {
while (1) {
switch (_context29.prev = _context29.next) {
switch (_context30.prev = _context30.next) {
case 0:

@@ -1499,10 +1537,10 @@ prevProjectionHashes = this.get('_app.projectionHashes');

if (this.storage) {
_context29.next = 4;
_context30.next = 4;
break;
}
return _context29.abrupt('return');
return _context30.abrupt('return');
case 4:
return _context29.abrupt('return', _promise2.default.all(collectionNames.map(function (collectionName) {
return _context30.abrupt('return', _promise2.default.all(collectionNames.map(function (collectionName) {
return _this3.storage.clearCollection(collectionName);

@@ -1513,9 +1551,9 @@ })));

case 'end':
return _context29.stop();
return _context30.stop();
}
}
}, _callee29, this);
}, _callee30, this);
}));
function onProjections(_x50) {
function onProjections(_x52) {
return ref.apply(this, arguments);

@@ -1547,18 +1585,18 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee30(message, forceSend) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee31(message, forceSend) {
var _this4 = this;
return _regenerator2.default.wrap(function _callee30$(_context30) {
return _regenerator2.default.wrap(function _callee31$(_context31) {
while (1) {
switch (_context30.prev = _context30.next) {
switch (_context31.prev = _context31.next) {
case 0:
if (!(!forceSend && (!this.inited || !this.online || !message.id))) {
_context30.next = 2;
_context31.next = 2;
break;
}
return _context30.abrupt('return');
return _context31.abrupt('return');
case 2:
return _context30.abrupt('return', new _promise2.default(function (resolve, reject) {
return _context31.abrupt('return', new _promise2.default(function (resolve, reject) {
var callback = function callback(err, value) {

@@ -1584,9 +1622,9 @@ if (err) return reject(err);

case 'end':
return _context30.stop();
return _context31.stop();
}
}
}, _callee30, this);
}, _callee31, this);
}));
function send(_x51, _x52) {
function send(_x53, _x54) {
return ref.apply(this, arguments);

@@ -1615,20 +1653,20 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee31(opData) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee32(opData) {
var op;
return _regenerator2.default.wrap(function _callee31$(_context31) {
return _regenerator2.default.wrap(function _callee32$(_context32) {
while (1) {
switch (_context31.prev = _context31.next) {
switch (_context32.prev = _context32.next) {
case 0:
op = this.createOp(opData);
return _context31.abrupt('return', this.send(op));
return _context32.abrupt('return', this.send(op));
case 2:
case 'end':
return _context31.stop();
return _context32.stop();
}
}
}, _callee31, this);
}, _callee32, this);
}));
function sendOp(_x53) {
function sendOp(_x55) {
return ref.apply(this, arguments);

@@ -1700,14 +1738,14 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee32() {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee33() {
var json, bundle;
return _regenerator2.default.wrap(function _callee32$(_context32) {
return _regenerator2.default.wrap(function _callee33$(_context33) {
while (1) {
switch (_context32.prev = _context32.next) {
switch (_context33.prev = _context33.next) {
case 0:
if (!this.onBundleReady) {
_context32.next = 3;
_context33.next = 3;
break;
}
_context32.next = 3;
_context33.next = 3;
return this.onBundleReady();

@@ -1717,7 +1755,7 @@

if (this.getBundleJsonFromDom) {
_context32.next = 5;
_context33.next = 5;
break;
}
return _context32.abrupt('return');
return _context33.abrupt('return');

@@ -1732,6 +1770,6 @@ case 5:

case 'end':
return _context32.stop();
return _context33.stop();
}
}
}, _callee32, this);
}, _callee33, this);
}));

@@ -1738,0 +1776,0 @@

@@ -57,2 +57,4 @@ 'use strict';

var _util = require('../util');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -281,6 +283,6 @@

}, {
key: 'del',
key: 'setDiff',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(field) {
var op;
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(field, value) {
var arraysField, previous;
return _regenerator2.default.wrap(function _callee7$(_context7) {

@@ -290,2 +292,38 @@ while (1) {

case 0:
arraysField = this.getFieldConsideringArrays(field);
previous = this.get(arraysField);
if (!(0, _util.fastEqual)(previous, value)) {
_context7.next = 4;
break;
}
return _context7.abrupt('return');
case 4:
return _context7.abrupt('return', this.set(field, value));
case 5:
case 'end':
return _context7.stop();
}
}
}, _callee7, this);
}));
function setDiff(_x5, _x6) {
return ref.apply(this, arguments);
}
return setDiff;
}()
}, {
key: 'del',
value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(field) {
var op;
return _regenerator2.default.wrap(function _callee8$(_context8) {
while (1) {
switch (_context8.prev = _context8.next) {
case 0:
field = this.getFieldConsideringArrays(field);

@@ -302,13 +340,13 @@

return _context7.abrupt('return', this.onOp(op));
return _context8.abrupt('return', this.onOp(op));
case 4:
case 'end':
return _context7.stop();
return _context8.stop();
}
}
}, _callee7, this);
}, _callee8, this);
}));
function del(_x5) {
function del(_x7) {
return ref.apply(this, arguments);

@@ -322,7 +360,7 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(field, value) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(field, value) {
var itemId, op;
return _regenerator2.default.wrap(function _callee8$(_context8) {
return _regenerator2.default.wrap(function _callee9$(_context9) {
while (1) {
switch (_context8.prev = _context8.next) {
switch (_context9.prev = _context9.next) {
case 0:

@@ -341,13 +379,13 @@ this.arraySetIfValueIsArray(field);

});
return _context8.abrupt('return', this.onOp(op));
return _context9.abrupt('return', this.onOp(op));
case 5:
case 'end':
return _context8.stop();
return _context9.stop();
}
}
}, _callee8, this);
}, _callee9, this);
}));
function push(_x6, _x7) {
function push(_x8, _x9) {
return ref.apply(this, arguments);

@@ -361,7 +399,7 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(field, value) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(field, value) {
var itemId, op;
return _regenerator2.default.wrap(function _callee9$(_context9) {
return _regenerator2.default.wrap(function _callee10$(_context10) {
while (1) {
switch (_context9.prev = _context9.next) {
switch (_context10.prev = _context10.next) {
case 0:

@@ -380,13 +418,13 @@ this.arraySetIfValueIsArray(field);

});
return _context9.abrupt('return', this.onOp(op));
return _context10.abrupt('return', this.onOp(op));
case 5:
case 'end':
return _context9.stop();
return _context10.stop();
}
}
}, _callee9, this);
}, _callee10, this);
}));
function unshift(_x8, _x9) {
function unshift(_x10, _x11) {
return ref.apply(this, arguments);

@@ -400,7 +438,7 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(field) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee11(field) {
var op;
return _regenerator2.default.wrap(function _callee10$(_context10) {
return _regenerator2.default.wrap(function _callee11$(_context11) {
while (1) {
switch (_context10.prev = _context10.next) {
switch (_context11.prev = _context11.next) {
case 0:

@@ -416,13 +454,13 @@ this.arraySetIfValueIsArray(field);

});
return _context10.abrupt('return', this.onOp(op));
return _context11.abrupt('return', this.onOp(op));
case 4:
case 'end':
return _context10.stop();
return _context11.stop();
}
}
}, _callee10, this);
}, _callee11, this);
}));
function pop(_x10) {
function pop(_x12) {
return ref.apply(this, arguments);

@@ -436,7 +474,7 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee11(field) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee12(field) {
var op;
return _regenerator2.default.wrap(function _callee11$(_context11) {
return _regenerator2.default.wrap(function _callee12$(_context12) {
while (1) {
switch (_context11.prev = _context11.next) {
switch (_context12.prev = _context12.next) {
case 0:

@@ -452,13 +490,13 @@ this.arraySetIfValueIsArray(field);

});
return _context11.abrupt('return', this.onOp(op));
return _context12.abrupt('return', this.onOp(op));
case 4:
case 'end':
return _context11.stop();
return _context12.stop();
}
}
}, _callee11, this);
}, _callee12, this);
}));
function shift(_x11) {
function shift(_x13) {
return ref.apply(this, arguments);

@@ -472,8 +510,8 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee12(field, index, values) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee13(field, index, values) {
var array, positionId, ops, type, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, value, itemId, _op, op;
return _regenerator2.default.wrap(function _callee12$(_context12) {
return _regenerator2.default.wrap(function _callee13$(_context13) {
while (1) {
switch (_context12.prev = _context12.next) {
switch (_context13.prev = _context13.next) {
case 0:

@@ -493,3 +531,3 @@ this.arraySetIfValueIsArray(field);

_iteratorError2 = undefined;
_context12.prev = 10;
_context13.prev = 10;
for (_iterator2 = (0, _getIterator3.default)(values); !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {

@@ -514,14 +552,14 @@ value = _step2.value;

_context12.next = 18;
_context13.next = 18;
break;
case 14:
_context12.prev = 14;
_context12.t0 = _context12['catch'](10);
_context13.prev = 14;
_context13.t0 = _context13['catch'](10);
_didIteratorError2 = true;
_iteratorError2 = _context12.t0;
_iteratorError2 = _context13.t0;
case 18:
_context12.prev = 18;
_context12.prev = 19;
_context13.prev = 18;
_context13.prev = 19;

@@ -533,6 +571,6 @@ if (!_iteratorNormalCompletion2 && _iterator2.return) {

case 21:
_context12.prev = 21;
_context13.prev = 21;
if (!_didIteratorError2) {
_context12.next = 24;
_context13.next = 24;
break;

@@ -544,6 +582,6 @@ }

case 24:
return _context12.finish(21);
return _context13.finish(21);
case 25:
return _context12.finish(18);
return _context13.finish(18);

@@ -565,13 +603,13 @@ case 26:

});
return _context12.abrupt('return', this.model.send(op));
return _context13.abrupt('return', this.model.send(op));
case 32:
case 'end':
return _context12.stop();
return _context13.stop();
}
}
}, _callee12, this, [[10, 14, 18, 26], [19,, 21, 25]]);
}, _callee13, this, [[10, 14, 18, 26], [19,, 21, 25]]);
}));
function insert(_x12, _x13, _x14) {
function insert(_x14, _x15, _x16) {
return ref.apply(this, arguments);

@@ -585,3 +623,3 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee13(field, index) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee14(field, index) {
var howMany = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2];

@@ -591,5 +629,5 @@

return _regenerator2.default.wrap(function _callee13$(_context13) {
return _regenerator2.default.wrap(function _callee14$(_context14) {
while (1) {
switch (_context13.prev = _context13.next) {
switch (_context14.prev = _context14.next) {
case 0:

@@ -607,7 +645,7 @@ this.arraySetIfValueIsArray(field);

if (positionId) {
_context13.next = 8;
_context14.next = 8;
break;
}
return _context13.abrupt('return');
return _context14.abrupt('return');

@@ -646,13 +684,13 @@ case 8:

});
return _context13.abrupt('return', this.model.send(op));
return _context14.abrupt('return', this.model.send(op));
case 15:
case 'end':
return _context13.stop();
return _context14.stop();
}
}
}, _callee13, this);
}, _callee14, this);
}));
function remove(_x15, _x16, _x17) {
function remove(_x17, _x18, _x19) {
return ref.apply(this, arguments);

@@ -666,3 +704,3 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee14(field, from, to) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee15(field, from, to) {
var howMany = arguments.length <= 3 || arguments[3] === undefined ? 1 : arguments[3];

@@ -672,5 +710,5 @@

return _regenerator2.default.wrap(function _callee14$(_context14) {
return _regenerator2.default.wrap(function _callee15$(_context15) {
while (1) {
switch (_context14.prev = _context14.next) {
switch (_context15.prev = _context15.next) {
case 0:

@@ -688,7 +726,7 @@ this.arraySetIfValueIsArray(field);

if (positionId) {
_context14.next = 8;
_context15.next = 8;
break;
}
return _context14.abrupt('return');
return _context15.abrupt('return');

@@ -738,13 +776,13 @@ case 8:

});
return _context14.abrupt('return', this.model.send(op));
return _context15.abrupt('return', this.model.send(op));
case 17:
case 'end':
return _context14.stop();
return _context15.stop();
}
}
}, _callee14, this);
}, _callee15, this);
}));
function move(_x19, _x20, _x21, _x22) {
function move(_x21, _x22, _x23, _x24) {
return ref.apply(this, arguments);

@@ -758,7 +796,7 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee15(field, from, to) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee16(field, from, to) {
var array, positionId, itemId, op;
return _regenerator2.default.wrap(function _callee15$(_context15) {
return _regenerator2.default.wrap(function _callee16$(_context16) {
while (1) {
switch (_context15.prev = _context15.next) {
switch (_context16.prev = _context16.next) {
case 0:

@@ -774,7 +812,7 @@ this.arraySetIfValueIsArray(field);

if (positionId) {
_context15.next = 6;
_context16.next = 6;
break;
}
return _context15.abrupt('return');
return _context16.abrupt('return');

@@ -785,7 +823,7 @@ case 6:

if (itemId) {
_context15.next = 9;
_context16.next = 9;
break;
}
return _context15.abrupt('return');
return _context16.abrupt('return');

@@ -804,13 +842,13 @@ case 9:

return _context15.abrupt('return', this.onOp(op));
return _context16.abrupt('return', this.onOp(op));
case 12:
case 'end':
return _context15.stop();
return _context16.stop();
}
}
}, _callee15, this);
}, _callee16, this);
}));
function swap(_x24, _x25, _x26) {
function swap(_x26, _x27, _x28) {
return ref.apply(this, arguments);

@@ -824,7 +862,7 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee16(field, value) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee17(field, value) {
var array, op;
return _regenerator2.default.wrap(function _callee16$(_context16) {
return _regenerator2.default.wrap(function _callee17$(_context17) {
while (1) {
switch (_context16.prev = _context16.next) {
switch (_context17.prev = _context17.next) {
case 0:

@@ -846,13 +884,13 @@ array = new _types.ArrayType();

return _context16.abrupt('return', this.onOp(op));
return _context17.abrupt('return', this.onOp(op));
case 6:
case 'end':
return _context16.stop();
return _context17.stop();
}
}
}, _callee16, this);
}, _callee17, this);
}));
function arraySet(_x27, _x28) {
function arraySet(_x29, _x30) {
return ref.apply(this, arguments);

@@ -866,8 +904,8 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee17(field, value) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee18(field, value) {
var previous, diffs, promises, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, diff;
return _regenerator2.default.wrap(function _callee17$(_context17) {
return _regenerator2.default.wrap(function _callee18$(_context18) {
while (1) {
switch (_context17.prev = _context17.next) {
switch (_context18.prev = _context18.next) {
case 0:

@@ -883,3 +921,3 @@ previous = this.get(field);

_iteratorError3 = undefined;
_context17.prev = 7;
_context18.prev = 7;
_iterator3 = (0, _getIterator3.default)(diffs);

@@ -889,3 +927,3 @@

if (_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done) {
_context17.next = 23;
_context18.next = 23;
break;

@@ -895,4 +933,4 @@ }

diff = _step3.value;
_context17.t0 = diff.type;
_context17.next = _context17.t0 === 'insert' ? 14 : _context17.t0 === 'remove' ? 16 : _context17.t0 === 'move' ? 18 : 20;
_context18.t0 = diff.type;
_context18.next = _context18.t0 === 'insert' ? 14 : _context18.t0 === 'remove' ? 16 : _context18.t0 === 'move' ? 18 : 20;
break;

@@ -902,30 +940,30 @@

promises.push(this.insert(field, diff.index, diff.values));
return _context17.abrupt('break', 20);
return _context18.abrupt('break', 20);
case 16:
promises.push(this.remove(field, diff.index, diff.howMany));
return _context17.abrupt('break', 20);
return _context18.abrupt('break', 20);
case 18:
promises.push(this.move(field, diff.from, diff.to, diff.howMany));
return _context17.abrupt('break', 20);
return _context18.abrupt('break', 20);
case 20:
_iteratorNormalCompletion3 = true;
_context17.next = 9;
_context18.next = 9;
break;
case 23:
_context17.next = 29;
_context18.next = 29;
break;
case 25:
_context17.prev = 25;
_context17.t1 = _context17['catch'](7);
_context18.prev = 25;
_context18.t1 = _context18['catch'](7);
_didIteratorError3 = true;
_iteratorError3 = _context17.t1;
_iteratorError3 = _context18.t1;
case 29:
_context17.prev = 29;
_context17.prev = 30;
_context18.prev = 29;
_context18.prev = 30;

@@ -937,6 +975,6 @@ if (!_iteratorNormalCompletion3 && _iterator3.return) {

case 32:
_context17.prev = 32;
_context18.prev = 32;
if (!_didIteratorError3) {
_context17.next = 35;
_context18.next = 35;
break;

@@ -948,19 +986,19 @@ }

case 35:
return _context17.finish(32);
return _context18.finish(32);
case 36:
return _context17.finish(29);
return _context18.finish(29);
case 37:
return _context17.abrupt('return', _promise2.default.all(promises));
return _context18.abrupt('return', _promise2.default.all(promises));
case 38:
case 'end':
return _context17.stop();
return _context18.stop();
}
}
}, _callee17, this, [[7, 25, 29, 37], [30,, 32, 36]]);
}, _callee18, this, [[7, 25, 29, 37], [30,, 32, 36]]);
}));
function arrayDiff(_x29, _x30) {
function arrayDiff(_x31, _x32) {
return ref.apply(this, arguments);

@@ -974,7 +1012,7 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee18(field) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee19(field) {
var op;
return _regenerator2.default.wrap(function _callee18$(_context18) {
return _regenerator2.default.wrap(function _callee19$(_context19) {
while (1) {
switch (_context18.prev = _context18.next) {
switch (_context19.prev = _context19.next) {
case 0:

@@ -992,13 +1030,13 @@ field = this.getFieldConsideringArrays(field);

return _context18.abrupt('return', this.onOp(op));
return _context19.abrupt('return', this.onOp(op));
case 4:
case 'end':
return _context18.stop();
return _context19.stop();
}
}
}, _callee18, this);
}, _callee19, this);
}));
function invert(_x31) {
function invert(_x33) {
return ref.apply(this, arguments);

@@ -1012,7 +1050,7 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee19(field, value) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee20(field, value) {
var op;
return _regenerator2.default.wrap(function _callee19$(_context19) {
return _regenerator2.default.wrap(function _callee20$(_context20) {
while (1) {
switch (_context19.prev = _context19.next) {
switch (_context20.prev = _context20.next) {
case 0:

@@ -1031,13 +1069,13 @@ field = this.getFieldConsideringArrays(field);

return _context19.abrupt('return', this.onOp(op));
return _context20.abrupt('return', this.onOp(op));
case 4:
case 'end':
return _context19.stop();
return _context20.stop();
}
}
}, _callee19, this);
}, _callee20, this);
}));
function increment(_x32, _x33) {
function increment(_x34, _x35) {
return ref.apply(this, arguments);

@@ -1051,8 +1089,8 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee20(field, index, value) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee21(field, index, value) {
var howMany, string, positionId, ops, type, _iteratorNormalCompletion4, _didIteratorError4, _iteratorError4, _iterator4, _step4, _value, charId, _op4, op;
return _regenerator2.default.wrap(function _callee20$(_context20) {
return _regenerator2.default.wrap(function _callee21$(_context21) {
while (1) {
switch (_context20.prev = _context20.next) {
switch (_context21.prev = _context21.next) {
case 0:

@@ -1081,3 +1119,3 @@ howMany = value.length;

_iteratorError4 = undefined;
_context20.prev = 10;
_context21.prev = 10;
for (_iterator4 = (0, _getIterator3.default)(value.split('')); !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {

@@ -1102,14 +1140,14 @@ _value = _step4.value;

_context20.next = 18;
_context21.next = 18;
break;
case 14:
_context20.prev = 14;
_context20.t0 = _context20['catch'](10);
_context21.prev = 14;
_context21.t0 = _context21['catch'](10);
_didIteratorError4 = true;
_iteratorError4 = _context20.t0;
_iteratorError4 = _context21.t0;
case 18:
_context20.prev = 18;
_context20.prev = 19;
_context21.prev = 18;
_context21.prev = 19;

@@ -1121,6 +1159,6 @@ if (!_iteratorNormalCompletion4 && _iterator4.return) {

case 21:
_context20.prev = 21;
_context21.prev = 21;
if (!_didIteratorError4) {
_context20.next = 24;
_context21.next = 24;
break;

@@ -1132,6 +1170,6 @@ }

case 24:
return _context20.finish(21);
return _context21.finish(21);
case 25:
return _context20.finish(18);
return _context21.finish(18);

@@ -1157,13 +1195,13 @@ case 26:

});
return _context20.abrupt('return', this.model.send(op));
return _context21.abrupt('return', this.model.send(op));
case 33:
case 'end':
return _context20.stop();
return _context21.stop();
}
}
}, _callee20, this, [[10, 14, 18, 26], [19,, 21, 25]]);
}, _callee21, this, [[10, 14, 18, 26], [19,, 21, 25]]);
}));
function stringInsert(_x34, _x35, _x36) {
function stringInsert(_x36, _x37, _x38) {
return ref.apply(this, arguments);

@@ -1177,3 +1215,3 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee21(field, index) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee22(field, index) {
var howMany = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2];

@@ -1183,5 +1221,5 @@

return _regenerator2.default.wrap(function _callee21$(_context21) {
return _regenerator2.default.wrap(function _callee22$(_context22) {
while (1) {
switch (_context21.prev = _context21.next) {
switch (_context22.prev = _context22.next) {
case 0:

@@ -1208,7 +1246,7 @@ string = this.getInternal(field);

if (positionId) {
_context21.next = 8;
_context22.next = 8;
break;
}
return _context21.abrupt('return');
return _context22.abrupt('return');

@@ -1251,13 +1289,13 @@ case 8:

});
return _context21.abrupt('return', this.model.send(op));
return _context22.abrupt('return', this.model.send(op));
case 16:
case 'end':
return _context21.stop();
return _context22.stop();
}
}
}, _callee21, this);
}, _callee22, this);
}));
function stringRemove(_x37, _x38, _x39) {
function stringRemove(_x39, _x40, _x41) {
return ref.apply(this, arguments);

@@ -1271,7 +1309,7 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee22(field, value) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee23(field, value) {
var string, op;
return _regenerator2.default.wrap(function _callee22$(_context22) {
return _regenerator2.default.wrap(function _callee23$(_context23) {
while (1) {
switch (_context22.prev = _context22.next) {
switch (_context23.prev = _context23.next) {
case 0:

@@ -1293,13 +1331,13 @@ string = new _types.StringType();

return _context22.abrupt('return', this.onOp(op));
return _context23.abrupt('return', this.onOp(op));
case 6:
case 'end':
return _context22.stop();
return _context23.stop();
}
}
}, _callee22, this);
}, _callee23, this);
}));
function stringSet(_x41, _x42) {
function stringSet(_x43, _x44) {
return ref.apply(this, arguments);

@@ -1313,7 +1351,7 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee23(field, value) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee24(field, value) {
var previous, start, end, promises, howMany, inserted;
return _regenerator2.default.wrap(function _callee23$(_context23) {
return _regenerator2.default.wrap(function _callee24$(_context24) {
while (1) {
switch (_context23.prev = _context23.next) {
switch (_context24.prev = _context24.next) {
case 0:

@@ -1325,7 +1363,7 @@ previous = this.get(field);

if (!(previous === value)) {
_context23.next = 4;
_context24.next = 4;
break;
}
return _context23.abrupt('return');
return _context24.abrupt('return');

@@ -1358,13 +1396,13 @@ case 4:

return _context23.abrupt('return', _promise2.default.all(promises));
return _context24.abrupt('return', _promise2.default.all(promises));
case 12:
case 'end':
return _context23.stop();
return _context24.stop();
}
}
}, _callee23, this);
}, _callee24, this);
}));
function stringDiff(_x43, _x44) {
function stringDiff(_x45, _x46) {
return ref.apply(this, arguments);

@@ -1378,7 +1416,7 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee24(field, value) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee25(field, value) {
var op;
return _regenerator2.default.wrap(function _callee24$(_context24) {
return _regenerator2.default.wrap(function _callee25$(_context25) {
while (1) {
switch (_context24.prev = _context24.next) {
switch (_context25.prev = _context25.next) {
case 0:

@@ -1394,13 +1432,13 @@ field = this.getFieldConsideringArrays(field);

});
return _context24.abrupt('return', this.onOp(op));
return _context25.abrupt('return', this.onOp(op));
case 3:
case 'end':
return _context24.stop();
return _context25.stop();
}
}
}, _callee24, this);
}, _callee25, this);
}));
function rich(_x45, _x46) {
function rich(_x47, _x48) {
return ref.apply(this, arguments);

@@ -1517,6 +1555,6 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee25(op) {
return _regenerator2.default.wrap(function _callee25$(_context25) {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee26(op) {
return _regenerator2.default.wrap(function _callee26$(_context26) {
while (1) {
switch (_context25.prev = _context25.next) {
switch (_context26.prev = _context26.next) {
case 0:

@@ -1526,13 +1564,13 @@ this.applyOp(op);

this.collection.emit('change', op);
return _context25.abrupt('return', this.save());
return _context26.abrupt('return', this.save());
case 4:
case 'end':
return _context25.stop();
return _context26.stop();
}
}
}, _callee25, this);
}, _callee26, this);
}));
function onOp(_x47) {
function onOp(_x49) {
return ref.apply(this, arguments);

@@ -1546,15 +1584,15 @@ }

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee26() {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee27() {
var _this2 = this;
return _regenerator2.default.wrap(function _callee26$(_context26) {
return _regenerator2.default.wrap(function _callee27$(_context27) {
while (1) {
switch (_context26.prev = _context26.next) {
switch (_context27.prev = _context27.next) {
case 0:
if (!(!this.model.storage || !this.ops.length)) {
_context26.next = 2;
_context27.next = 2;
break;
}
return _context26.abrupt('return');
return _context27.abrupt('return');

@@ -1570,6 +1608,6 @@ case 2:

case 'end':
return _context26.stop();
return _context27.stop();
}
}
}, _callee26, this);
}, _callee27, this);
}));

@@ -1586,10 +1624,10 @@

value: function () {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee27() {
var ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee28() {
var _this3 = this;
return _regenerator2.default.wrap(function _callee27$(_context27) {
return _regenerator2.default.wrap(function _callee28$(_context28) {
while (1) {
switch (_context27.prev = _context27.next) {
switch (_context28.prev = _context28.next) {
case 0:
return _context27.abrupt('return', this.model.storage.saveDoc(this.collection.name, this.docId, this.ops, this.serverVersion).catch(function (err) {
return _context28.abrupt('return', this.model.storage.saveDoc(this.collection.name, this.docId, this.ops, this.serverVersion).catch(function (err) {
console.error('MutableDoc.save', _this3.collection.name, err);

@@ -1601,6 +1639,6 @@ console.log('Probably, you have not added collection ' + _this3.collection.name + '\n to store options. For IndexedDB app version should be increased also');

case 'end':
return _context27.stop();
return _context28.stop();
}
}
}, _callee27, this);
}, _callee28, this);
}));

@@ -1607,0 +1645,0 @@

@@ -78,3 +78,3 @@ 'use strict';

op = this.projection.projectOp(op);
(0, _get3.default)((0, _getPrototypeOf2.default)(ProjectedDoc.prototype), 'receiveOp', this).call(this, op);
if (op) (0, _get3.default)((0, _getPrototypeOf2.default)(ProjectedDoc.prototype), 'receiveOp', this).call(this, op);
}

@@ -90,9 +90,12 @@ }, {

op = this.projection.projectOp(op);
if (!op) return;
} else if (op.type === 'fetch' || op.type === 'sub') {
op.ops = op.ops.map(function (docOp) {
return _this2.projection.projectOp(docOp);
}).filter(function (docOp) {
return docOp;
});
}
if (op) (0, _get3.default)((0, _getPrototypeOf2.default)(ProjectedDoc.prototype), 'sendOp', this).call(this, op, channel);
(0, _get3.default)((0, _getPrototypeOf2.default)(ProjectedDoc.prototype), 'sendOp', this).call(this, op, channel);
}

@@ -99,0 +102,0 @@ }, {

@@ -63,2 +63,4 @@ 'use strict';

return _this2.projection.projectOp(docOp);
}).filter(function (docOp) {
return docOp;
});

@@ -65,0 +67,0 @@ projectedDocs[docId] = projectedOps;

{
"name": "amelisa",
"version": "0.1.27",
"version": "0.1.28",
"description": "Data engine with offline and realtime",

@@ -5,0 +5,0 @@ "browser": "lib/web",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc