@koopjs/winnow
Advanced tools
Comparing version 4.0.2 to 4.0.3
{ | ||
"name": "@koopjs/winnow", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "Apply sql-like filters to GeoJSON", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -5,3 +5,3 @@ const _ = require('lodash'); | ||
module.exports = function transformToEsriProperties (inputProperties, geometry, delimitedDateFields, requiresObjectId, idField) { | ||
module.exports = function transformToEsriProperties (properties, geometry, delimitedDateFields, requiresObjectId, idField) { | ||
requiresObjectId = requiresObjectId === 'true'; | ||
@@ -11,18 +11,17 @@ idField = idField === 'null' ? null : idField; | ||
const dateFields = delimitedDateFields.split(','); | ||
const properties = transformProperties(inputProperties, dateFields); | ||
if (requiresObjectId && !idField) { | ||
return injectObjectId({ properties, geometry }); | ||
properties = injectObjectId({ properties, geometry }); | ||
} | ||
if (requiresObjectId && shouldLogIdFieldWarning(properties[idField])) { | ||
logger.debug(`OBJECTIDs created from provider's "idField" (${idField}: ${inputProperties[idField]}) are not integers from 0 to 2147483647`); | ||
logger.debug(`OBJECTIDs created from provider's "idField" (${idField}: ${properties[idField]}) are not integers from 0 to 2147483647`); | ||
} | ||
return properties; | ||
return transformProperties(properties, dateFields); | ||
}; | ||
function injectObjectId (feature) { | ||
const { properties } = feature; | ||
const OBJECTID = createIntegerHash(JSON.stringify(feature)); | ||
const { properties, geometry } = feature; | ||
const OBJECTID = createIntegerHash(JSON.stringify({ properties, geometry })); | ||
return { | ||
@@ -34,4 +33,4 @@ ...properties, | ||
function shouldLogIdFieldWarning (idField) { | ||
return (!Number.isInteger(idField) || idField > 2147483647); | ||
function shouldLogIdFieldWarning (idFieldValue) { | ||
return idFieldValue && (!Number.isInteger(idFieldValue) || idFieldValue > 2147483647); | ||
} | ||
@@ -38,0 +37,0 @@ |
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
94762
1956