lib/services/components.js
function put(uri, data, locals) {
  let model = files.getComponentModule(getComponentName(uri)),
    callHooks = _.get(locals, 'hooks') !== 'false',
    result;

  if (model && _.isFunction(model.save) && callHooks) {
    result = models.put(model, uri, data, locals);
  } else {
    result = dbOps.putDefaultBehavior(uri, data);
  }

  return result;
}
function put(uri, data, locals) {
  let model = files.getComponentModule(getComponentName(uri)),
    callHooks = _.get(locals, 'hooks') !== 'false',
    result;

  if (model && _.isFunction(model.save) && callHooks) {
    result = models.put(model, uri, data, locals);
  } else {
    result = dbOps.putDefaultBehavior(uri, data);
  }

  return result;
}
function put ( uri , data , locals ) { let model = files . getComponentModule ( getComponentName ( uri ) ) , callHooks = _ . get ( locals , 'hooks' ) !== 'false' , result ; if ( model && _ . isFunction ( model . save ) && callHooks ) { result = models . put ( model , uri , data , locals ) ; } else { result = dbOps . putDefaultBehavior ( uri , data ) ; } return result ; }
Given a component uri, its data and the locals
check if there exists a model.js file for the
component.

If yes, run the model.js. If not, turn the component
data into ops.

@param {String} uri
@param {String} data
@param {Object} [locals]
@returns {Promise}
Given a component uri its data and the locals check if there exists a model . js file for the component .