refactor: move ts-circular-dependencies tool to dev-infra (#35647)
PR Close #35647
This commit is contained in:

committed by
Andrew Kushnir

parent
9ea53803f7
commit
7aab399c84
23
dev-infra/ts-circular-dependencies/file_system.ts
Normal file
23
dev-infra/ts-circular-dependencies/file_system.ts
Normal file
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {Stats, statSync} from 'fs';
|
||||
|
||||
/** Gets the status of the specified file. Returns null if the file does not exist. */
|
||||
export function getFileStatus(filePath: string): Stats|null {
|
||||
try {
|
||||
return statSync(filePath);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** Ensures that the specified path uses forward slashes as delimiter. */
|
||||
export function convertPathToForwardSlash(path: string) {
|
||||
return path.replace(/\\/g, '/');
|
||||
}
|
Reference in New Issue
Block a user