From 6d42c391c53064eeca5311230930b2e545cb13d6 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Wed, 25 Nov 2020 11:29:04 +0000 Subject: [PATCH] Added JSDoc comments into package-json lib --- ghost/package-json/lib/package-json.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ghost/package-json/lib/package-json.js b/ghost/package-json/lib/package-json.js index 0b3045fd77..0e9628be01 100644 --- a/ghost/package-json/lib/package-json.js +++ b/ghost/package-json/lib/package-json.js @@ -63,6 +63,8 @@ module.exports = class PackageJson { /** * Parse package.json and validate it has * all the required fields + * + * @param {string} path */ async parse(path) { let source; @@ -105,6 +107,8 @@ module.exports = class PackageJson { /** * Recursively read directory and find the packages in it * + * @param {string} absolutePath + * @param {string} packageName * @returns {object} */ async processPackage(absolutePath, packageName) { @@ -127,6 +131,10 @@ module.exports = class PackageJson { return pkg; } + /** + * @param {string} packagePath + * @param {string} packageName + */ async readPackage(packagePath, packageName) { const absolutePath = join(packagePath, packageName); @@ -150,6 +158,9 @@ module.exports = class PackageJson { } } + /** + * @param {string} packagePath + */ readPackages(packagePath) { const self = this;