src/index.js
function convertAttribute (attribute, field) {
  const inValue = attribute[field.name]
  let value

  if (inValue === null) return inValue

  if (field.domain && field.domain.type === 'codedValue') {
    value = cvd(inValue, field)
  } else if (field.type === 'esriFieldTypeDate') {
    try {
      value = new Date(inValue).toISOString()
    } catch (e) {
      value = inValue
    }
  } else {
    value = inValue
  }
  return value
}
function convertAttribute (attribute, field) {
  const inValue = attribute[field.name]
  let value

  if (inValue === null) return inValue

  if (field.domain && field.domain.type === 'codedValue') {
    value = cvd(inValue, field)
  } else if (field.type === 'esriFieldTypeDate') {
    try {
      value = new Date(inValue).toISOString()
    } catch (e) {
      value = inValue
    }
  } else {
    value = inValue
  }
  return value
}
function convertAttribute ( attribute , field ) { const inValue = attribute [ field . name ] let value if ( inValue === null ) return inValue if ( field . domain && field . domain . type === 'codedValue' ) { value = cvd ( inValue , field ) } else if ( field . type === 'esriFieldTypeDate' ) { try { value = new Date ( inValue ) . toISOString ( ) } catch ( e ) { value = inValue } } else { value = inValue } return value }
Decodes an attributes CVD and standardizes any date fields

@params {object} attribute - a single esri feature attribute
@params {object} field - the field metadata describing that attribute
@returns {object} outAttribute - the converted attribute
@private
Decodes an attributes CVD and standardizes any date fields