lib/memory-engine.js
function checkForIdAndData(object, callback) {
    var id = object[options.idProperty]
      , foundObject
    if (id === undefined || id === null) {
      return callback(new Error('Object has no \''
        + options.idProperty + '\' property'))
    }

    foundObject = findById(id)

    if (foundObject === null) {
      return callback(new Error('No object found with \''
        + options.idProperty + '\' = \'' + id + '\''))
    }

    return callback(null, foundObject)
  }
function checkForIdAndData(object, callback) {
    var id = object[options.idProperty]
      , foundObject
    if (id === undefined || id === null) {
      return callback(new Error('Object has no \''
        + options.idProperty + '\' property'))
    }

    foundObject = findById(id)

    if (foundObject === null) {
      return callback(new Error('No object found with \''
        + options.idProperty + '\' = \'' + id + '\''))
    }

    return callback(null, foundObject)
  }
function checkForIdAndData ( object , callback ) { var id = object [ options . idProperty ] , foundObject if ( id === undefined || id === null ) { return callback ( new Error ( 'Object has no \'' + options . idProperty + '\' property' ) ) } foundObject = findById ( id ) if ( foundObject === null ) { return callback ( new Error ( 'No object found with \'' + options . idProperty + '\' = \'' + id + '\'' ) ) } return callback ( null , foundObject ) }
Checks that the object has the ID property present, then checks
if the data object has that ID value present.e

Returns an Error to the callback if either of the above checks fail

@param {Object} object to check
@param {Function} callback
@api private
Checks that the object has the ID property present then checks if the data object has that ID value present . e