Skip to content

Commit 99ef222

Browse files
committed
refactor: backward compatible path function
1 parent a0b5461 commit 99ef222

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/linter/rules/absolute-path.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ const PathFunctions: Record<string, (df: DataflowGraph, vtx: DataflowGraphVertex
9393
df, vtx, undefined, 'fsep', true
9494
);
9595
// in the future we can access `.Platform$file.sep` here
96-
const sepValues: string[] = new Array(...fsep?.values()?.flatMap(s => [...s].filter(isNotUndefined)) ?? [path.sep]);
96+
const v = fsep?.values();
97+
const sepValues: string[] = v ? [...v].flatMap(s => [...s].filter(isNotUndefined)) : [path.sep];
9798
if(sepValues.some(s => s === Unknown || isUndefined(s))) {
9899
// if we have no fsep, we cannot construct a path
99100
return undefined;

0 commit comments

Comments
 (0)