Skip to content
This repository has been archived by the owner on May 19, 2019. It is now read-only.

Commit

Permalink
0.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Artemyev committed Jan 1, 2016
1 parent a4ea979 commit c95242b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 32 deletions.
33 changes: 18 additions & 15 deletions build/marsdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,10 @@ var _DocumentSorter = require('./DocumentSorter');

var _DocumentSorter2 = _interopRequireDefault(_DocumentSorter);

var _EJSON = require('./EJSON');

var _EJSON2 = _interopRequireDefault(_EJSON);

function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
Expand Down Expand Up @@ -1034,7 +1038,10 @@ var Cursor = (function (_EventEmitter) {
var _this3 = this;

this._executing = this._matchObjects().then(function (docs) {
return _this3.processPipeline(docs);
var clonned = (0, _map3.default)(docs, function (doc) {
return _EJSON2.default.clone(doc);
});
return _this3.processPipeline(clonned);
}).then(function (docs) {
_this3._executing = null;
return docs;
Expand Down Expand Up @@ -1127,7 +1134,7 @@ var Cursor = (function (_EventEmitter) {
exports.Cursor = Cursor;
exports.default = Cursor;

},{"./DocumentMatcher":7,"./DocumentRetriver":9,"./DocumentSorter":10,"check-types":17,"eventemitter3":18,"fast.js/forEach":24,"fast.js/map":26,"invariant":33,"keymirror":32}],5:[function(require,module,exports){
},{"./DocumentMatcher":7,"./DocumentRetriver":9,"./DocumentSorter":10,"./EJSON":11,"check-types":17,"eventemitter3":18,"fast.js/forEach":24,"fast.js/map":26,"invariant":33,"keymirror":32}],5:[function(require,module,exports){
'use strict';

function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; }
Expand Down Expand Up @@ -5477,10 +5484,6 @@ Object.defineProperty(exports, "__esModule", {
});
exports.StorageManager = undefined;

var _keys2 = require('fast.js/object/keys');

var _keys3 = _interopRequireDefault(_keys2);

var _forEach = require('fast.js/forEach');

var _forEach2 = _interopRequireDefault(_forEach);
Expand Down Expand Up @@ -5547,7 +5550,7 @@ var StorageManager = exports.StorageManager = (function () {
value: function destroy() {
var _this2 = this;

return this._loadedPromise.then(function () {
return this.loaded().then(function () {
_this2._storage = {};
});
}
Expand All @@ -5556,7 +5559,7 @@ var StorageManager = exports.StorageManager = (function () {
value: function persist(key, value) {
var _this3 = this;

return this._loadedPromise.then(function () {
return this.loaded().then(function () {
_this3._storage[key] = _EJSON2.default.clone(value);
});
}
Expand All @@ -5565,7 +5568,7 @@ var StorageManager = exports.StorageManager = (function () {
value: function _delete(key) {
var _this4 = this;

return this._loadedPromise.then(function () {
return this.loaded().then(function () {
delete _this4._storage[key];
});
}
Expand All @@ -5574,8 +5577,8 @@ var StorageManager = exports.StorageManager = (function () {
value: function get(key) {
var _this5 = this;

return this._loadedPromise.then(function () {
return _EJSON2.default.clone(_this5._storage[key]);
return this.loaded().then(function () {
return _this5._storage[key];
});
}
}, {
Expand All @@ -5584,9 +5587,9 @@ var StorageManager = exports.StorageManager = (function () {
var _this6 = this;

var emitter = new _eventemitter2.default();
this._loadedPromise.then(function () {
(0, _forEach2.default)((0, _keys3.default)(_this6._storage), function (k) {
emitter.emit('data', { value: _EJSON2.default.clone(_this6._storage[k]) });
this.loaded().then(function () {
(0, _forEach2.default)(_this6._storage, function (v, k) {
emitter.emit('data', { value: v });
});
emitter.emit('end');
});
Expand All @@ -5604,7 +5607,7 @@ var StorageManager = exports.StorageManager = (function () {

exports.default = StorageManager;

},{"./EJSON":11,"./PromiseQueue":13,"eventemitter3":18,"fast.js/forEach":24,"fast.js/object/keys":29}],16:[function(require,module,exports){
},{"./EJSON":11,"./PromiseQueue":13,"eventemitter3":18,"fast.js/forEach":24}],16:[function(require,module,exports){
'use strict';

var Collection = require('./dist/Collection').default;
Expand Down
6 changes: 3 additions & 3 deletions build/marsdb.min.js

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion dist/Cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ var _DocumentSorter = require('./DocumentSorter');

var _DocumentSorter2 = _interopRequireDefault(_DocumentSorter);

var _EJSON = require('./EJSON');

var _EJSON2 = _interopRequireDefault(_EJSON);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; }
Expand Down Expand Up @@ -301,7 +305,10 @@ var Cursor = (function (_EventEmitter) {
var _this3 = this;

this._executing = this._matchObjects().then(function (docs) {
return _this3.processPipeline(docs);
var clonned = (0, _map3.default)(docs, function (doc) {
return _EJSON2.default.clone(doc);
});
return _this3.processPipeline(clonned);
}).then(function (docs) {
_this3._executing = null;
return docs;
Expand Down
20 changes: 8 additions & 12 deletions dist/StorageManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ Object.defineProperty(exports, "__esModule", {
});
exports.StorageManager = undefined;

var _keys2 = require('fast.js/object/keys');

var _keys3 = _interopRequireDefault(_keys2);

var _forEach = require('fast.js/forEach');

var _forEach2 = _interopRequireDefault(_forEach);
Expand Down Expand Up @@ -71,7 +67,7 @@ var StorageManager = exports.StorageManager = (function () {
value: function destroy() {
var _this2 = this;

return this._loadedPromise.then(function () {
return this.loaded().then(function () {
_this2._storage = {};
});
}
Expand All @@ -80,7 +76,7 @@ var StorageManager = exports.StorageManager = (function () {
value: function persist(key, value) {
var _this3 = this;

return this._loadedPromise.then(function () {
return this.loaded().then(function () {
_this3._storage[key] = _EJSON2.default.clone(value);
});
}
Expand All @@ -89,7 +85,7 @@ var StorageManager = exports.StorageManager = (function () {
value: function _delete(key) {
var _this4 = this;

return this._loadedPromise.then(function () {
return this.loaded().then(function () {
delete _this4._storage[key];
});
}
Expand All @@ -98,8 +94,8 @@ var StorageManager = exports.StorageManager = (function () {
value: function get(key) {
var _this5 = this;

return this._loadedPromise.then(function () {
return _EJSON2.default.clone(_this5._storage[key]);
return this.loaded().then(function () {
return _this5._storage[key];
});
}
}, {
Expand All @@ -108,9 +104,9 @@ var StorageManager = exports.StorageManager = (function () {
var _this6 = this;

var emitter = new _eventemitter2.default();
this._loadedPromise.then(function () {
(0, _forEach2.default)((0, _keys3.default)(_this6._storage), function (k) {
emitter.emit('data', { value: _EJSON2.default.clone(_this6._storage[k]) });
this.loaded().then(function () {
(0, _forEach2.default)(_this6._storage, function (v, k) {
emitter.emit('data', { value: v });
});
emitter.emit('end');
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "marsdb",
"version": "0.4.1",
"version": "0.4.2",
"author": {
"name": "Artem Artemev",
"email": "art@studytime.me"
Expand Down

0 comments on commit c95242b

Please sign in to comment.