function resolveRefPathAt(reference, index, scope, obj) {
  const rp = reference.refPaths[index];
  if (rp.varName === undefined) {
    // Return the value at the referenced path in the input object
    return get(obj, rp.path);
  }
  // Retrieve the referenced variable/validator
  const isValidator = rp.varName.startsWith('$');
  const value = scope.find(rp.varName, VAR_NOT_FOUND);
  if (value === VAR_NOT_FOUND) {
    reference.setError(`Unresolved ${isValidator ? 'validator' : 'value'} reference to '${rp.varName}'`);
    return undefined;
  }
  // Return either the validator or the value at the referenced path in the variable
  return isValidator ? value : get(value, rp.path);
}
// Any error is reported to the reference by setting its error property
Any error is reported to the reference by setting its error property
Any error is reported to the reference by setting its error property
function resolveRefPathAt(reference, index, scope, obj) {
  const rp = reference.refPaths[index];
  if (rp.varName === undefined) {
    return get(obj, rp.path);
  }
  const isValidator = rp.varName.startsWith('$');
  const value = scope.find(rp.varName, VAR_NOT_FOUND);
  if (value === VAR_NOT_FOUND) {
    reference.setError(`Unresolved ${isValidator ? 'validator' : 'value'} reference to '${rp.varName}'`);
    return undefined;
  }
  return isValidator ? value : get(value, rp.path);
}
function resolveRefPathAt ( reference , index , scope , obj ) { const rp = reference . refPaths [ index ] ; if ( rp . varName === undefined ) { return get ( obj , rp . path ) ; } const isValidator = rp . varName . startsWith ( '$' ) ; const value = scope . find ( rp . varName , VAR_NOT_FOUND ) ; if ( value === VAR_NOT_FOUND ) { reference . setError ( ` ${ isValidator ? 'validator' : 'value' } ${ rp . varName } ` ) ; return undefined ; } return isValidator ? value : get ( value , rp . path ) ; }
Any error is reported to the reference by setting its error property
Any error is reported to the reference by setting its error property
// Return the value at the referenced path in the input object // Retrieve the referenced variable/validator // Return either the validator or the value at the referenced path in the variable