can-query-logic
Advanced tools
Comparing version 0.7.5 to 0.8.0
@@ -219,1 +219,17 @@ require("./src/types/make-real-number-range-inclusive-test"); | ||
}); | ||
QUnit.test("isPaginated, removePagination", function(assert){ | ||
assert.equal( algebra.isPaginated({}), false, "universe is not paginated"); | ||
assert.equal( algebra.isPaginated({filter: {foo: "bar"}}), false, "filter is not paginated"); | ||
assert.equal( algebra.isPaginated({sort: "bar"}), false, "sort is not paginated"); | ||
assert.equal( algebra.isPaginated({page: {start: 1, end: 2}}), true, "page is paginated"); | ||
assert.deepEqual( algebra.removePagination({}), {}, "removePagination universe"); | ||
assert.deepEqual( algebra.removePagination({filter: {foo: "bar"}}), {filter: {foo: "bar"}}, "removePagination filter"); | ||
assert.deepEqual( algebra.removePagination({sort: "bar"}), {sort: "bar"}, "removePagination sort"); | ||
assert.deepEqual( algebra.removePagination({page: {start: 1, end: 2}}), {}, "removePagination page"); | ||
}); |
@@ -151,4 +151,14 @@ var set = require("./src/set"); | ||
return copy; | ||
} | ||
}, | ||
isPaginated: function(query) { | ||
var basicQuery = this.hydrate(query); | ||
return !set.isEqual(basicQuery.page, set.UNIVERSAL); | ||
}, | ||
removePagination: function(query) { | ||
var basicQuery = this.hydrate(query); | ||
basicQuery.removePagination(); | ||
return this.serialize( basicQuery ); | ||
}, | ||
}); | ||
@@ -155,0 +165,0 @@ |
{ | ||
"name": "can-query-logic", | ||
"version": "0.7.5", | ||
"version": "0.8.0", | ||
"description": "query data", | ||
@@ -5,0 +5,0 @@ "homepage": "", |
@@ -125,2 +125,5 @@ var set = require("../set"); | ||
return this.filter.isMember(props); | ||
}, | ||
removePagination: function(){ | ||
this.page = new RecordRange(); | ||
} | ||
@@ -382,2 +385,2 @@ }); | ||
module.exports = BasicQuery; | ||
module.exports = BasicQuery; |
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
364169
9840