reactivedb
Advanced tools
Comparing version 0.7.0-alpha.18 to 0.7.1
@@ -79,11 +79,15 @@ "use strict"; | ||
var meta = metaDatas[0]; | ||
var skips = metaDatas | ||
.map(function (m) { return m.skip; }) | ||
.sort(function (x, y) { return x - y; }); | ||
var db = meta.db, lselect = meta.lselect, shape = meta.shape, predicateProvider = meta.predicateProvider, limit = meta.limit; | ||
var minSkip = skips[0]; | ||
if (!skips.every(function (s, i) { return s === limit * i; })) { | ||
throw RuntimeError_1.TOKEN_CONCAT_ERR("\n skip should be serial,\n expect:\n " + JSON.stringify(skips.map(function (_, i) { return i * limit; }), null, 2) + ", limit = " + limit + "\n actual:\n " + JSON.stringify(skips, null, 2) + "\n "); | ||
} | ||
return new Selector(db, lselect, shape, predicateProvider, limit * skips.length, minSkip); | ||
var skipsAndLimits = metaDatas | ||
.map(function (m) { return ({ skip: m.skip, limit: m.limit }); }) | ||
.sort(function (x, y) { return x.skip - y.skip; }); | ||
var db = meta.db, lselect = meta.lselect, shape = meta.shape, predicateProvider = meta.predicateProvider; | ||
var minSkip = skipsAndLimits[0]; | ||
var maxLimit = skipsAndLimits.reduce(function (acc, current) { | ||
var nextSkip = acc.skip + acc.limit; | ||
if (current.skip !== nextSkip) { | ||
throw RuntimeError_1.TOKEN_CONCAT_ERR("\n skip should be serial,\n expect: " + JSON.stringify(acc, null, 2) + "\n actual: " + nextSkip + "\n "); | ||
} | ||
return current; | ||
}); | ||
return new Selector(db, lselect, shape, predicateProvider, maxLimit.limit + maxLimit.skip, minSkip.skip); | ||
}; | ||
@@ -90,0 +94,0 @@ Selector.combineFactory = function () { |
@@ -1,2 +0,2 @@ | ||
declare var _default: "0.7.0-alpha.18"; | ||
declare var _default: "0.7.1"; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = '0.7.0-alpha.18'; | ||
exports.default = '0.7.1'; | ||
//# sourceMappingURL=version.js.map |
@@ -77,11 +77,15 @@ import './RxOperator'; | ||
var meta = metaDatas[0]; | ||
var skips = metaDatas | ||
.map(function (m) { return m.skip; }) | ||
.sort(function (x, y) { return x - y; }); | ||
var db = meta.db, lselect = meta.lselect, shape = meta.shape, predicateProvider = meta.predicateProvider, limit = meta.limit; | ||
var minSkip = skips[0]; | ||
if (!skips.every(function (s, i) { return s === limit * i; })) { | ||
throw TOKEN_CONCAT_ERR("\n skip should be serial,\n expect:\n " + JSON.stringify(skips.map(function (_, i) { return i * limit; }), null, 2) + ", limit = " + limit + "\n actual:\n " + JSON.stringify(skips, null, 2) + "\n "); | ||
} | ||
return new Selector(db, lselect, shape, predicateProvider, limit * skips.length, minSkip); | ||
var skipsAndLimits = metaDatas | ||
.map(function (m) { return ({ skip: m.skip, limit: m.limit }); }) | ||
.sort(function (x, y) { return x.skip - y.skip; }); | ||
var db = meta.db, lselect = meta.lselect, shape = meta.shape, predicateProvider = meta.predicateProvider; | ||
var minSkip = skipsAndLimits[0]; | ||
var maxLimit = skipsAndLimits.reduce(function (acc, current) { | ||
var nextSkip = acc.skip + acc.limit; | ||
if (current.skip !== nextSkip) { | ||
throw TOKEN_CONCAT_ERR("\n skip should be serial,\n expect: " + JSON.stringify(acc, null, 2) + "\n actual: " + nextSkip + "\n "); | ||
} | ||
return current; | ||
}); | ||
return new Selector(db, lselect, shape, predicateProvider, maxLimit.limit + maxLimit.skip, minSkip.skip); | ||
}; | ||
@@ -88,0 +92,0 @@ Selector.combineFactory = function () { |
@@ -1,2 +0,2 @@ | ||
declare var _default: "0.7.0-alpha.18"; | ||
declare var _default: "0.7.1"; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
export default '0.7.0-alpha.18'; | ||
export default '0.7.1'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "reactivedb", | ||
"version": "0.7.0-alpha.18", | ||
"version": "0.7.1", | ||
"description": "Reactive ORM for Lovefield", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
@@ -8,2 +8,1 @@ import './global' | ||
export { Selector } from './storage/Selector' | ||
@@ -31,17 +31,19 @@ import './RxOperator' | ||
const [ meta ] = metaDatas | ||
const skips = metaDatas | ||
.map(m => m.skip) | ||
.sort((x, y) => x - y) | ||
const { db, lselect, shape, predicateProvider, limit } = meta | ||
const [ minSkip ] = skips | ||
if (!skips.every((s, i) => s === limit * i) ) { | ||
throw TOKEN_CONCAT_ERR(` | ||
skip should be serial, | ||
expect: | ||
${ JSON.stringify(skips.map((_, i) => i * limit), null, 2) }, limit = ${ limit } | ||
actual: | ||
${ JSON.stringify(skips, null, 2) } | ||
`) | ||
} | ||
return new Selector(db, lselect, shape, predicateProvider, limit * skips.length, minSkip) | ||
const skipsAndLimits = metaDatas | ||
.map(m => ({ skip: m.skip, limit: m.limit })) | ||
.sort((x, y) => x.skip - y.skip) | ||
const { db, lselect, shape, predicateProvider } = meta | ||
const [ minSkip ] = skipsAndLimits | ||
const maxLimit = skipsAndLimits.reduce((acc, current) => { | ||
const nextSkip = acc.skip + acc.limit | ||
if (current.skip !== nextSkip) { | ||
throw TOKEN_CONCAT_ERR(` | ||
skip should be serial, | ||
expect: ${JSON.stringify(acc, null, 2)} | ||
actual: ${nextSkip} | ||
`) | ||
} | ||
return current | ||
}) | ||
return new Selector(db, lselect, shape, predicateProvider, maxLimit.limit + maxLimit.skip, minSkip.skip) | ||
} | ||
@@ -48,0 +50,0 @@ |
@@ -1,1 +0,1 @@ | ||
export default '0.7.0-alpha.18' | ||
export default '0.7.1' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
401336
6430