* The constructor. * @param {Object} config The config. * @param {String} config.nodeModulesPath The path to the node_modules directory. * @param {String} config.packageJsonPath The path to the parent package.json file.
(config)
| 16 | * @param {String} config.packageJsonPath The path to the parent package.json file. |
| 17 | */ |
| 18 | constructor(config) { |
| 19 | const { |
| 20 | nodeModulesPath, |
| 21 | packageJsonPath, |
| 22 | } = config; |
| 23 | |
| 24 | // Ensure required params are set |
| 25 | if ([ |
| 26 | nodeModulesPath, |
| 27 | packageJsonPath, |
| 28 | ].includes(undefined)) { |
| 29 | throw 'invalid configuration'; |
| 30 | } |
| 31 | |
| 32 | this.nodeModulesPath = nodeModulesPath; |
| 33 | this.packageJsonPath = packageJsonPath; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Returns an array of `package.json` files under the given path and subdirectories. |
nothing calls this directly
no outgoing calls
no test coverage detected