lib/modules/queryBuilder.js
function getStateFromOptions (options, propertyName) {
  propertyName = propertyName || 'state';
  const stateName = options[propertyName] || options.resource.defaultState;
  let stateObj = options.resource.states[stateName] || {validate: false};
  stateObj.name = stateName;
  return stateObj;
}
function getStateFromOptions (options, propertyName) {
  propertyName = propertyName || 'state';
  const stateName = options[propertyName] || options.resource.defaultState;
  let stateObj = options.resource.states[stateName] || {validate: false};
  stateObj.name = stateName;
  return stateObj;
}
Retreive the state object descriptor from its name
@param {object} options
@param {string} [propertyName]
@returns {State}