Updated JSDoc optional syntax in CRUD plugin

no issue

- optional parameters can be given in square brackets which makes
  editors understand it easier
This commit is contained in:
Daniel Lockyer 2021-06-17 15:04:52 +01:00
parent a622f44564
commit a635f3b68d
No known key found for this signature in database
GPG Key ID: D21186F0B47295AD

View File

@ -9,7 +9,7 @@ module.exports = function (Bookshelf) {
/**
* ### Find All
* Fetches all the data for a particular model
* @param {Object} unfilteredOptions (optional)
* @param {Object} [unfilteredOptions]
* @return {Promise<Bookshelf['Collection']>} Collection of all Models
*/
findAll: async function findAll(unfilteredOptions) {
@ -108,7 +108,7 @@ module.exports = function (Bookshelf) {
* ### Find One
* Naive find one where data determines what to match on
* @param {Object} data
* @param {Object} unfilteredOptions (optional)
* @param {Object} [unfilteredOptions]
* @return {Promise<Bookshelf['Model']>} Single Model
*/
findOne: function findOne(data, unfilteredOptions) {
@ -137,7 +137,7 @@ module.exports = function (Bookshelf) {
* Based on the `method` option Bookshelf and Ghost can determine if a query is an insert or an update.
*
* @param {Object} data
* @param {Object} unfilteredOptions (optional)
* @param {Object} [unfilteredOptions]
* @return {Promise<Bookshelf['Model']>} Edited Model
*/
edit: async function edit(data, unfilteredOptions) {
@ -170,7 +170,7 @@ module.exports = function (Bookshelf) {
* ### Add
* Naive add
* @param {Object} data
* @param {Object} unfilteredOptions (optional)
* @param {Object} [unfilteredOptions]
* @return {Promise<Bookshelf['Model']>} Newly Added Model
*/
add: function add(data, unfilteredOptions) {
@ -195,7 +195,7 @@ module.exports = function (Bookshelf) {
/**
* ### Destroy
* Naive destroy
* @param {Object} unfilteredOptions (optional)
* @param {Object} [unfilteredOptions]
* @return {Promise<Bookshelf['Model']>} Empty Model
*/
destroy: async function destroy(unfilteredOptions) {