mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
13 lines
448 B
TypeScript
13 lines
448 B
TypeScript
|
/* eslint-disable import/prefer-default-export */
|
||
|
|
||
|
import { GlobOptionsWithFileTypesFalse, sync } from 'glob';
|
||
|
|
||
|
// Wraps glob.sync but with good default options so that it works across
|
||
|
// platforms and with consistent sorting.
|
||
|
export const globSync = (pattern: string | string[], options: GlobOptionsWithFileTypesFalse) => {
|
||
|
let output = sync(pattern, options);
|
||
|
output = output.map(f => f.replace(/\\/g, '/'));
|
||
|
output.sort();
|
||
|
return output;
|
||
|
};
|