File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1047,7 +1047,7 @@ export function ls(optionsOrPaths?: unknown, ...paths: unknown[]): string[] {
10471047
10481048 // Flatten paths if the paths argument is array
10491049 if ( Array . isArray ( paths ) ) {
1050- paths = paths . flat ( Infinity ) ;
1050+ paths = flattenArray ( paths ) ;
10511051 }
10521052
10531053 // If the first argument is not options, then it is a path
@@ -1121,6 +1121,12 @@ export function ls(optionsOrPaths?: unknown, ...paths: unknown[]): string[] {
11211121 }
11221122}
11231123
1124+ function flattenArray ( arr : any [ ] ) : any [ ] {
1125+ return arr . reduce ( ( flat , toFlatten ) => {
1126+ return flat . concat ( Array . isArray ( toFlatten ) ? flattenArray ( toFlatten ) : toFlatten ) ;
1127+ } , [ ] ) ;
1128+ }
1129+
11241130type CopyOptionsVariants = OptionsPermutations < 'frn' > ;
11251131
11261132/**
You can’t perform that action at this time.
0 commit comments