index.js
function determineValue(keys, doc) {
  try {
    for (const key of keys) {
      doc = doc[key];
    }

    /**
      the keys array should transition through any nesting,
      so any object is assumed to be enumValues:
        { value: 'string', enumValues: ['strings'] }
     */
    return typeof doc === 'object' ? doc.value : doc;
  } catch (error) { return doc; }
}
function determineValue(keys, doc) {
  try {
    for (const key of keys) {
      doc = doc[key];
    }

    /**
      the keys array should transition through any nesting,
      so any object is assumed to be enumValues:
        { value: 'string', enumValues: ['strings'] }
     */
    return typeof doc === 'object' ? doc.value : doc;
  } catch (error) { return doc; }
}
function determineValue ( keys , doc ) { try { for ( const key of keys ) { doc = doc [ key ] ; } /**
      the keys array should transition through any nesting,
      so any object is assumed to be enumValues:
        { value: 'string', enumValues: ['strings'] }
     */ return typeof doc === 'object' ? doc . value : doc ; } catch ( error ) { return doc ; } }
Traverse the passed document, according to keys, appropriating the desired value
@param [String]: keys -- an array of keys determining the path to value
@param Object: doc -- the document that contains the value at keys path
@return any: -- the value at the end of keys path in document
Traverse the passed document according to keys appropriating the desired value