Added jsdocs to UrlGenerator/Resource classes

no issue

- The @param {Resource} syntax was not semantically correct. After the change TypeScript is picking up a correct parameter
This commit is contained in:
Naz 2020-11-17 13:05:40 +13:00
parent 33bc3c9011
commit 05e12d4b5a
2 changed files with 5 additions and 1 deletions

View File

@ -6,6 +6,10 @@ const errors = require('@tryghost/errors');
* Resource cache.
*/
class Resource extends EventEmitter {
/**
* @param {('posts'|'pages'|'tags'|'authors')} type - of the resource
* @param {Object} obj - object data to sotre
*/
constructor(type, obj) {
super();

View File

@ -142,7 +142,7 @@ class UrlGenerator {
/**
* @description Try to own a resource and generate it's url if so.
* @param {Resource} resource
* @param {import('./Resource')} resource - instance of the Resource class
* @returns {boolean}
* @private
*/