* Declare a dependency from one project in the graph to another * * @public * @param {string} fromProjectName Name of the depending project * @param {string} toProjectName Name of project on which the other depends
(fromProjectName, toProjectName)
| 199 | * @param {string} toProjectName Name of project on which the other depends |
| 200 | */ |
| 201 | declareOptionalDependency(fromProjectName, toProjectName) { |
| 202 | this._checkSealed(); |
| 203 | try { |
| 204 | log.verbose(`Declaring optional dependency: ${fromProjectName} depends on ${toProjectName}`); |
| 205 | this._declareDependency(this._optAdjList, fromProjectName, toProjectName); |
| 206 | this._hasUnresolvedOptionalDependencies = true; |
| 207 | } catch (err) { |
| 208 | throw new Error( |
| 209 | `Failed to declare optional dependency from project ${fromProjectName} to ${toProjectName}: ` + |
| 210 | err.message); |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | /** |
| 215 | * Declare a dependency from one project in the graph to another |
no test coverage detected