Fix JSDoc - remove newlines from function alias declarations, etc.

This commit is contained in:
crandmck 2014-05-07 11:24:49 -07:00
parent a765ea31ab
commit cf75f55f73
1 changed files with 16 additions and 18 deletions

View File

@ -209,6 +209,7 @@ function stillConnecting(dataSource, obj, args) {
/** /**
* Update or insert a model instance. * Update or insert a model instance.
* `updateOrCreate` is an alias
* @param {Object} data The model instance data * @param {Object} data The model instance data
* @param {Function} callback The callback function (optional). * @param {Function} callback The callback function (optional).
*/ */
@ -470,7 +471,6 @@ DataAccessObject._coerce = function (where) {
* - limit: Number * - limit: Number
* - skip: Number * - skip: Number
* *
* @param {Object} params (optional)
* @param {Function} callback (required) called with two arguments: err (null or Error), array of instances * @param {Function} callback (required) called with two arguments: err (null or Error), array of instances
*/ */
@ -628,9 +628,7 @@ setRemoting(DataAccessObject.findOne, {
* @param {Object} [where] An object that defines the criteria * @param {Object} [where] An object that defines the criteria
* @param {Function} [cb] Callback called with (err) * @param {Function} [cb] Callback called with (err)
*/ */
DataAccessObject.remove = DataAccessObject.remove = DataAccessObject.deleteAll = DataAccessObject.destroyAll = function destroyAll(where, cb) {
DataAccessObject.deleteAll =
DataAccessObject.destroyAll = function destroyAll(where, cb) {
if (stillConnecting(this.getDataSource(), this, arguments)) return; if (stillConnecting(this.getDataSource(), this, arguments)) return;
var Model = this; var Model = this;
@ -655,13 +653,13 @@ DataAccessObject.remove =
}; };
/** /**
* Destroy a record by id * Delete the record with the specified ID.
* Aliases are `destroyById` and `deleteById`.
* @param {*} id The id value * @param {*} id The id value
* @param {Function} cb Callback called with (err) * @param {Function} cb Callback called with (err)
*/ */
DataAccessObject.removeById =
DataAccessObject.deleteById = DataAccessObject.removeById = DataAccessObject.deleteById = DataAccessObject.destroyById = function deleteById(id, cb) {
DataAccessObject.destroyById = function deleteById(id, cb) {
if (stillConnecting(this.getDataSource(), this, arguments)) return; if (stillConnecting(this.getDataSource(), this, arguments)) return;
var Model = this; var Model = this;
@ -708,10 +706,12 @@ setRemoting(DataAccessObject.count, {
}); });
/** /**
* Save instance. When instance haven't id, create method called instead. * Save instance. If the instance does not have an ID, call `create` instead.
* Triggers: validate, save, update | create * Triggers: validate, save, update or create.
* @param options {validate: true, throws: false} [optional] * @options {Object} options Optional options to use.
* @param callback(err, obj) * @property {Boolean} validate Default is true.
* @property {Boolean} throws Default is false.
* @param {Function} callback Callback function with err and object arguments
*/ */
DataAccessObject.prototype.save = function (options, callback) { DataAccessObject.prototype.save = function (options, callback) {
if (stillConnecting(this.getDataSource(), this, arguments)) return; if (stillConnecting(this.getDataSource(), this, arguments)) return;
@ -821,9 +821,8 @@ DataAccessObject.prototype.remove =
}; };
/** /**
* Update single attribute * Update a single attribute.
* * Equivalent to `updateAttributes({name: value}, cb)`
* equals to `updateAttributes({name: value}, cb)
* *
* @param {String} name Name of property * @param {String} name Name of property
* @param {Mixed} value Value of property * @param {Mixed} value Value of property
@ -836,9 +835,8 @@ DataAccessObject.prototype.updateAttribute = function updateAttribute(name, valu
}; };
/** /**
* Update set of attributes * Update saet of attributes.
* * Performs validation before updating.
* this method performs validation before updating
* *
* @trigger `validation`, `save` and `update` hooks * @trigger `validation`, `save` and `update` hooks
* @param {Object} data Data to update * @param {Object} data Data to update