mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Added JSDoc comments into package-json lib
This commit is contained in:
parent
90f7cf9e67
commit
ed2a21bef4
1 changed files with 11 additions and 0 deletions
|
@ -63,6 +63,8 @@ module.exports = class PackageJson {
|
||||||
/**
|
/**
|
||||||
* Parse package.json and validate it has
|
* Parse package.json and validate it has
|
||||||
* all the required fields
|
* all the required fields
|
||||||
|
*
|
||||||
|
* @param {string} path
|
||||||
*/
|
*/
|
||||||
async parse(path) {
|
async parse(path) {
|
||||||
let source;
|
let source;
|
||||||
|
@ -105,6 +107,8 @@ module.exports = class PackageJson {
|
||||||
/**
|
/**
|
||||||
* Recursively read directory and find the packages in it
|
* Recursively read directory and find the packages in it
|
||||||
*
|
*
|
||||||
|
* @param {string} absolutePath
|
||||||
|
* @param {string} packageName
|
||||||
* @returns {object}
|
* @returns {object}
|
||||||
*/
|
*/
|
||||||
async processPackage(absolutePath, packageName) {
|
async processPackage(absolutePath, packageName) {
|
||||||
|
@ -127,6 +131,10 @@ module.exports = class PackageJson {
|
||||||
return pkg;
|
return pkg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} packagePath
|
||||||
|
* @param {string} packageName
|
||||||
|
*/
|
||||||
async readPackage(packagePath, packageName) {
|
async readPackage(packagePath, packageName) {
|
||||||
const absolutePath = join(packagePath, packageName);
|
const absolutePath = join(packagePath, packageName);
|
||||||
|
|
||||||
|
@ -150,6 +158,9 @@ module.exports = class PackageJson {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} packagePath
|
||||||
|
*/
|
||||||
readPackages(packagePath) {
|
readPackages(packagePath) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue