Comparing version 1.12.3 to 1.12.4
@@ -5,2 +5,6 @@ # Change Log | ||
## [1.12.4] - 10-5-2017 | ||
### Changed | ||
* Add metadata.limitExceeded true/false on limit queries to denote whether the limit restricted the number of features returned | ||
## [1.12.3] - 09-22-2017 | ||
@@ -213,2 +217,3 @@ ### Fixed | ||
[1.12.4]: https://github.com/featureserver/winnow/compare/v1.12.3...v1.12.4 | ||
[1.12.3]: https://github.com/featureserver/winnow/compare/v1.12.2...v1.12.3 | ||
@@ -215,0 +220,0 @@ [1.12.2]: https://github.com/featureserver/winnow/compare/v1.12.1...v1.12.2 |
@@ -34,2 +34,3 @@ 'use strict' | ||
var filtered = [] | ||
var limitExceeded = false | ||
if (options.offset) { | ||
@@ -42,4 +43,14 @@ if (options.offset >= features.length) { throw new Error('OFFSET >= features length: ' + options) } | ||
if (result) { filtered.push(result) } | ||
return filtered.length === options.limit | ||
if (filtered.length === (options.limit + 1)) { | ||
limitExceeded = true | ||
return true | ||
} | ||
}) | ||
if (limitExceeded) { filtered = filtered.slice(0, -1) } | ||
if (options.collection) { | ||
options.collection.metadata = Object.assign({}, options.collection.metadata, { limitExceeded: limitExceeded }) | ||
} | ||
return finishQuery(filtered, options) | ||
@@ -46,0 +57,0 @@ } |
{ | ||
"name": "winnow", | ||
"version": "1.12.3", | ||
"version": "1.12.4", | ||
"description": "Apply sql-like filters to GeoJSON", | ||
@@ -42,7 +42,7 @@ "main": "dist/index.js", | ||
"proj4": "^2.3.17", | ||
"simple-statistics": "^4.1.1", | ||
"simple-statistics": "^5.0.0", | ||
"terraformer": "^1.0.7" | ||
}, | ||
"devDependencies": { | ||
"buble": "^0.15.2", | ||
"buble": "^0.16.0", | ||
"feature-parser": "^1.0.1", | ||
@@ -49,0 +49,0 @@ "standard": "^10.0.1", |
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
77763
1301
+ Addedsimple-statistics@5.4.0(transitive)
- Removedsimple-statistics@4.1.1(transitive)
Updatedsimple-statistics@^5.0.0