@koopjs/winnow
Advanced tools
Comparing version 5.0.0 to 5.0.1
{ | ||
"name": "@koopjs/winnow", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Apply sql-like filters to GeoJSON", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -13,4 +13,6 @@ const _ = require('lodash'); | ||
properties = injectObjectId({ properties, geometry }); | ||
} else if (requiresObjectId && shouldLogIdFieldWarning(properties[idField])) { | ||
logManager.logger.debug(`Unique-identifier (\`${idField}\`) has a value (${properties[idField]}) that is not a valid integer (0 to ${Number.MAX_SAFE_INTEGER}); this may cause problems in some clients.`); | ||
} else if (requiresObjectId && shouldLogIdFieldDataTypeWarning(properties[idField])) { | ||
logManager.logger.debug(`Unique-identifier ("${idField}") has a value (${properties[idField]}) that is not an integer-type, it is a ${typeof properties[idField]}; this may cause problems in some clients.`); | ||
} else if (requiresObjectId && shouldLogIdFieldRangeWarning(properties[idField])) { | ||
logManager.logger.debug(`Unique-identifier ("${idField}") has a value (${properties[idField]}) that is not a valid integer range (0 to ${Number.MAX_SAFE_INTEGER}); this may cause problems in some clients.`); | ||
} | ||
@@ -30,6 +32,10 @@ | ||
function shouldLogIdFieldWarning (idFieldValue) { | ||
return idFieldValue && (!Number.isInteger(idFieldValue) || idFieldValue > Number.MAX_SAFE_INTEGER); | ||
function shouldLogIdFieldDataTypeWarning (idFieldValue) { | ||
return idFieldValue && !Number.isInteger(idFieldValue); | ||
} | ||
function shouldLogIdFieldRangeWarning (idFieldValue) { | ||
return idFieldValue && (idFieldValue < 0 || idFieldValue > Number.MAX_SAFE_INTEGER); | ||
} | ||
function transformProperties (properties, dateFields) { | ||
@@ -36,0 +42,0 @@ return Object.entries(properties).reduce((transformedProperties, [key, value]) => { |
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
86878
2086