1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-24 08:12:24 +02:00
joplin/packages/utils/fs.ts

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;
};