mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-11 10:22:13 +00:00
uses the current tgui eslint and upgrades react to 18.2. At least it will stop worrying about the line length
34 lines
606 B
JavaScript
34 lines
606 B
JavaScript
/**
|
|
* @file
|
|
* @copyright 2020 Aleksej Komarov
|
|
* @license MIT
|
|
*/
|
|
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
|
|
import { require } from './require.js';
|
|
|
|
const globPkg = require('glob');
|
|
|
|
export const resolvePath = path.resolve;
|
|
|
|
/**
|
|
* Combines path.resolve with glob patterns.
|
|
*/
|
|
export const resolveGlob = (...sections) => {
|
|
const unsafePaths = globPkg.sync(path.resolve(...sections), {
|
|
strict: false,
|
|
silent: true,
|
|
});
|
|
const safePaths = [];
|
|
for (let path of unsafePaths) {
|
|
try {
|
|
fs.statSync(path);
|
|
safePaths.push(path);
|
|
}
|
|
catch {}
|
|
}
|
|
return safePaths;
|
|
};
|