Added JSDoc to MaxLimit constructor

refs https://github.com/TryGhost/Team/issues/587

- Having a JSDoc gives better intellisense when the class is instantiated and provides clues about what each parameter might be used for
This commit is contained in:
Naz 2021-04-01 17:29:26 +13:00
parent 57e24b3677
commit 0838186abd

View File

@ -28,6 +28,16 @@ class Limit {
}
class MaxLimit extends Limit {
/**
*
* @param {Object} options
* @param {String} options.name - name of the limit
* @param {Object} options.config - limit configuration
* @param {Number} options.config.max - maximum limit the limit would check against
* @param {Function} options.config.currentCountQuery - query checking the state that would be compared against the limit
* @param {String} options.helpLink - URL to the resource explaining how the limit works
* @param {Object} options.db - instance of knex db connection that currentCountQuery can use to run state check through
*/
constructor({name, config, helpLink, db}) {
super({name, error: config.error || '', helpLink, db});