Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 439d5d8

Browse files
x87FrozenPandaz
andcommittedOct 9, 2020
fix(core): fix resolving projects for imports to '..' (#3846)
* fix(core): fix resolving projects for imports to '..' * fix(core): fix formatting Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
1 parent 8c85bf9 commit 439d5d8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

‎packages/workspace/src/utils/fileutils.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ describe('fileutils', () => {
4242
expect(isRelativePath('./file')).toEqual(true);
4343
});
4444
it('should return true for upper imports', () => {
45+
expect(isRelativePath('..')).toEqual(true);
4546
expect(isRelativePath('../file')).toEqual(true);
4647
});
4748
it('should return false for absolute imports', () => {

‎packages/workspace/src/utils/fileutils.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,10 @@ export function renameSync(
112112
}
113113

114114
export function isRelativePath(path: string): boolean {
115-
return path === '.' || path.startsWith('./') || path.startsWith('../');
115+
return (
116+
path === '.' ||
117+
path === '..' ||
118+
path.startsWith('./') ||
119+
path.startsWith('../')
120+
);
116121
}

0 commit comments

Comments
 (0)
Please sign in to comment.