You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO: commented o until we need it and schema is solidified
191
+
// TODO: commented out until we need it and schema is solidified
97
192
// public showDependencyChainsOfPackage(
98
193
// depId: string,
99
194
// prependToExistingChain: string[] = []
@@ -118,71 +213,4 @@ export class DependencyTree<BuildDependency extends BuildDependencyPartial> {
118
213
// });
119
214
// return chains;
120
215
// }
121
-
122
-
/**
123
-
* Finds a dependency out of the list of deps using its id
124
-
* @param depId
125
-
* @private
126
-
* @throws Error
127
-
*/
128
-
privatelookupDepById(depId: string){
129
-
constdep=this.flatDeps.find((d)=>d.id===depId);
130
-
if(!dep){
131
-
thrownewError(
132
-
`Couldnt find dependency during lookup, make sure DependencyTree was constructed with this dep included: ${depId}`
133
-
);
134
-
}
135
-
returndep;
136
-
}
137
-
138
-
/**
139
-
* Gets all the ranges that a package was requested with
140
-
* Note that this wont show ranges of different versions of the package in the tree, just ranges that resolved to the exact version/release.
141
-
* ex: if you had react 4.1.1 and react 5.1.1 in your tree, this would output something like `['>4.0.0, '4.1.1'] and not '>5.0.0' because that's resolved as a different package in the package-lock
142
-
* @param depId
143
-
* @throws Error
144
-
*/
145
-
146
-
// public getRangesRequestedOfPackage(depId: string): string[] {
147
-
// const ranges: string[] = [];
148
-
//
149
-
// // find the dep and see if it was required directly by the project
150
-
// const dep = this.lookupDepById(depId);
151
-
// if (dep.root_range) {
152
-
// ranges.push(dep.root_range);
153
-
// }
154
-
//
155
-
// // go through all the deps and look for transitive dependencies on this dep
156
-
// this.flatDeps.forEach((d) => {
157
-
// // pick out what relationships in the tree point to this package
* See if we can update a package to a fixed version(s) without violating semver
168
-
* @param toVersions Since there might be multiple fix versions for a vulnerability, take a list of possible ones we could update to in `toVersions`
169
-
* @param depId
170
-
*/
171
-
// public determinePackageTriviallyUpdatable(toVersions: string[], depId: string): boolean {
172
-
// return toVersions.some((toVersion) => {
173
-
// // I think coercing like this is a good idea because it will make things like `1.2.3-hotfix` appear valid against the ranges, and a lot of patches might be like that
174
-
// // Maybe it will do that automatically, need to test. Awful docs for this library.
0 commit comments