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

13 lines
448 B
TypeScript
Raw Normal View History

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