Skip to content

Commit 2cf374a

Browse files
committed
refactor(@angular-devkit/build-angular): remove unused findUp method
1 parent 52d14d7 commit 2cf374a

File tree

1 file changed

+0
-28
lines changed
  • packages/angular_devkit/build_angular/src/utils

1 file changed

+0
-28
lines changed

packages/angular_devkit/build_angular/src/utils/find-up.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,6 @@ import { existsSync } from 'fs';
99
import * as path from 'path';
1010
import { isDirectory } from './is-directory';
1111

12-
export function findUp(names: string | string[], from: string, stopOnNodeModules = false): string | null {
13-
if (!Array.isArray(names)) {
14-
names = [names];
15-
}
16-
const root = path.parse(from).root;
17-
18-
let currentDir = from;
19-
while (currentDir && currentDir !== root) {
20-
for (const name of names) {
21-
const p = path.join(currentDir, name);
22-
if (existsSync(p)) {
23-
return p;
24-
}
25-
}
26-
27-
if (stopOnNodeModules) {
28-
const nodeModuleP = path.join(currentDir, 'node_modules');
29-
if (existsSync(nodeModuleP)) {
30-
return null;
31-
}
32-
}
33-
34-
currentDir = path.dirname(currentDir);
35-
}
36-
37-
return null;
38-
}
39-
4012
export function findAllNodeModules(from: string, root?: string): string[] {
4113
const nodeModules: string[] = [];
4214

0 commit comments

Comments
 (0)