src/sql.js
function esriFy (properties, geometry, dateFields, requiresObjectId, idField) {
  const parsedDateFields = (dateFields.length === 0) ? [] : dateFields.split(',')
  if (parsedDateFields.length) {
    parsedDateFields.forEach(field => {
      properties[field] = new Date(properties[field]).getTime()
    })
  }

  // If the object ID is not needed, return here
  if (requiresObjectId === 'false') return properties

  // Coerce idField
  idField = (idField === 'null') ? null : idField

  // If the idField for the model set use its value as OBJECTID
  if (idField) {
    if (process.env.NODE_ENV !== 'production' && process.env.KOOP_WARNINGS !== 'suppress' && (!Number.isInteger(properties[idField]) || properties[idField] > 2147483647)) {
      console.warn(`WARNING: OBJECTIDs created from provider's "idField" are not integers from 0 to 2147483647`)
    }
  } else {
    // Create an OBJECTID by creating a numeric hash from the stringified feature
    // Note possibility of OBJECTID collisions with this method still exists, but should be small
    properties.OBJECTID = createIntHash(JSON.stringify({ properties, geometry }))
  }
  return properties
}
function esriFy (properties, geometry, dateFields, requiresObjectId, idField) {
  const parsedDateFields = (dateFields.length === 0) ? [] : dateFields.split(',')
  if (parsedDateFields.length) {
    parsedDateFields.forEach(field => {
      properties[field] = new Date(properties[field]).getTime()
    })
  }

  // If the object ID is not needed, return here
  if (requiresObjectId === 'false') return properties

  // Coerce idField
  idField = (idField === 'null') ? null : idField

  // If the idField for the model set use its value as OBJECTID
  if (idField) {
    if (process.env.NODE_ENV !== 'production' && process.env.KOOP_WARNINGS !== 'suppress' && (!Number.isInteger(properties[idField]) || properties[idField] > 2147483647)) {
      console.warn(`WARNING: OBJECTIDs created from provider's "idField" are not integers from 0 to 2147483647`)
    }
  } else {
    // Create an OBJECTID by creating a numeric hash from the stringified feature
    // Note possibility of OBJECTID collisions with this method still exists, but should be small
    properties.OBJECTID = createIntHash(JSON.stringify({ properties, geometry }))
  }
  return properties
}
function esriFy ( properties , geometry , dateFields , requiresObjectId , idField ) { const parsedDateFields = ( dateFields . length === 0 ) ? [ ] : dateFields . split ( ',' ) if ( parsedDateFields . length ) { parsedDateFields . forEach ( field => { properties [ field ] = new Date ( properties [ field ] ) . getTime ( ) } ) } // If the object ID is not needed, return here if ( requiresObjectId === 'false' ) return properties // Coerce idField idField = ( idField === 'null' ) ? null : idField // If the idField for the model set use its value as OBJECTID if ( idField ) { if ( process . env . NODE_ENV !== 'production' && process . env . KOOP_WARNINGS !== 'suppress' && ( ! Number . isInteger ( properties [ idField ] ) || properties [ idField ] > 2147483647 ) ) { console . warn ( ` ` ) } } else { // Create an OBJECTID by creating a numeric hash from the stringified feature // Note possibility of OBJECTID collisions with this method still exists, but should be small properties . OBJECTID = createIntHash ( JSON . stringify ( { properties , geometry } ) ) } return properties }
Modify propterties to fit ESRI specs
@param {object} properties GeoJSON properties
@param {object} geometry GeoJSON geometry
@param {string} dateFields comma-delimited list of date fields
@param {string} requiresObjectId boolean-string flagging requirement of OBJECTID as part of properties
@param {string} idField name of attribute to be used as OBJECTID
Modify propterties to fit ESRI specs