From 05e12d4b5a45b8a00abab1a226f5fa976a901ae2 Mon Sep 17 00:00:00 2001 From: Naz Date: Tue, 17 Nov 2020 13:05:40 +1300 Subject: [PATCH] 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 --- core/frontend/services/url/Resource.js | 4 ++++ core/frontend/services/url/UrlGenerator.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/frontend/services/url/Resource.js b/core/frontend/services/url/Resource.js index a996f9a6e0..d2d2c7cfc1 100644 --- a/core/frontend/services/url/Resource.js +++ b/core/frontend/services/url/Resource.js @@ -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(); diff --git a/core/frontend/services/url/UrlGenerator.js b/core/frontend/services/url/UrlGenerator.js index 915efbf5e2..e783212ae4 100644 --- a/core/frontend/services/url/UrlGenerator.js +++ b/core/frontend/services/url/UrlGenerator.js @@ -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 */