Skip to content

Commit eed5840

Browse files
committed
style(virtualtype): touch-up jsdoc
1 parent c82d85a commit eed5840

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

lib/virtualtype.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ const utils = require('./utils');
1313
* fullname instanceof mongoose.VirtualType // true
1414
*
1515
* @param {Object} options
16-
* @param {string|function} [options.ref] if `ref` is not nullish, this becomes a [populated virtual](/docs/populate.html#populate-virtuals)
17-
* @param {string|function} [options.localField] the local field to populate on if this is a populated virtual.
18-
* @param {string|function} [options.foreignField] the foreign field to populate on if this is a populated virtual.
19-
* @param {boolean} [options.justOne=false] by default, a populated virtual is an array. If you set `justOne`, the populated virtual will be a single doc or `null`.
20-
* @param {boolean} [options.getters=false] if you set this to `true`, Mongoose will call any custom getters you defined on this virtual
21-
* @param {boolean} [options.count=false] if you set this to `true`, `populate()` will set this virtual to the number of populated documents, as opposed to the documents themselves, using [`Query#countDocuments()`](./api.html#query_Query-countDocuments)
16+
* @param {String|Function} [options.ref] if `ref` is not nullish, this becomes a [populated virtual](/docs/populate.html#populate-virtuals)
17+
* @param {String|Function} [options.localField] the local field to populate on if this is a populated virtual.
18+
* @param {String|Function} [options.foreignField] the foreign field to populate on if this is a populated virtual.
19+
* @param {Boolean} [options.justOne=false] by default, a populated virtual is an array. If you set `justOne`, the populated virtual will be a single doc or `null`.
20+
* @param {Boolean} [options.getters=false] if you set this to `true`, Mongoose will call any custom getters you defined on this virtual
21+
* @param {Boolean} [options.count=false] if you set this to `true`, `populate()` will set this virtual to the number of populated documents, as opposed to the documents themselves, using [`Query#countDocuments()`](./api.html#query_Query-countDocuments)
2222
* @param {Object|Function} [options.match=null] add an extra match condition to `populate()`
2323
* @param {Number} [options.limit=null] add a default `limit` to the `populate()` query
2424
* @param {Number} [options.skip=null] add a default `skip` to the `populate()` query
2525
* @param {Number} [options.perDocumentLimit=null] For legacy reasons, `limit` with `populate()` may give incorrect results because it only executes a single query for every document being populated. If you set `perDocumentLimit`, Mongoose will ensure correct `limit` per document by executing a separate query for each document to `populate()`. For example, `.find().populate({ path: 'test', perDocumentLimit: 2 })` will execute 2 additional queries if `.find()` returns 2 documents.
2626
* @param {Object} [options.options=null] Additional options like `limit` and `lean`.
27-
* @param {string} name
27+
* @param {String} name
2828
* @api public
2929
*/
3030

@@ -36,10 +36,8 @@ function VirtualType(options, name) {
3636
}
3737

3838
/**
39-
* If no getters/getters, add a default
39+
* If no getters/setters, add a default
4040
*
41-
* @param {Function} fn
42-
* @return {VirtualType} this
4341
* @api private
4442
*/
4543

@@ -85,7 +83,7 @@ VirtualType.prototype.clone = function() {
8583
* return this.name.first + ' ' + this.name.last;
8684
* });
8785
*
88-
* @param {function} fn
86+
* @param {Function} fn
8987
* @return {VirtualType} this
9088
* @api public
9189
*/
@@ -120,7 +118,7 @@ VirtualType.prototype.get = function(fn) {
120118
* doc.name.first; // 'Jean-Luc'
121119
* doc.name.last; // 'Picard'
122120
*
123-
* @param {function} fn
121+
* @param {Function} fn
124122
* @return {VirtualType} this
125123
* @api public
126124
*/
@@ -135,7 +133,7 @@ VirtualType.prototype.set = function(fn) {
135133
*
136134
* @param {Object} value
137135
* @param {Document} doc The document this virtual is attached to
138-
* @return {any} the value after applying all getters
136+
* @return {Any} the value after applying all getters
139137
* @api public
140138
*/
141139

@@ -158,7 +156,7 @@ VirtualType.prototype.applyGetters = function(value, doc) {
158156
*
159157
* @param {Object} value
160158
* @param {Document} doc
161-
* @return {any} the value after applying all setters
159+
* @return {Any} the value after applying all setters
162160
* @api public
163161
*/
164162

0 commit comments

Comments
 (0)