lib/run-time/feathers/extract-items.js
function extractFirstItem (result) {
  const data = extractAllItems(result);
  if (!data) return null;
  
  if (data.length > 1) throw new Error(`service.find expected 0 or 1 objects, not ${data.length}. (extractFirstItem)`);

  return data.length ? data[0] : null;
}
function extractFirstItem (result) {
  const data = extractAllItems(result);
  if (!data) return null;
  
  if (data.length > 1) throw new Error(`service.find expected 0 or 1 objects, not ${data.length}. (extractFirstItem)`);

  return data.length ? data[0] : null;
}
function extractFirstItem ( result ) { const data = extractAllItems ( result ) ; if ( ! data ) return null ; if ( data . length > 1 ) throw new Error ( ` ${ data . length } ` ) ; return data . length ? data [ 0 ] : null ; }
Return the first and only object from a Feathers service call, or null if none.
Return the first and only object from a Feathers service call or null if none .