mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
17 lines
456 B
JavaScript
17 lines
456 B
JavaScript
// "path" imports point to a specific location and don't require
|
|
// module directory resolution. This RegExp should capture import
|
|
// statements that:
|
|
//
|
|
// - start with `./`
|
|
// - start with `../`
|
|
// - equal `..`
|
|
// - equal `.`
|
|
// - start with `C:\`
|
|
// - start with `C:/`
|
|
// - start with `/`
|
|
//
|
|
const PATH_IMPORT_RE = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/;
|
|
|
|
exports.getIsPathRequest = function(source) {
|
|
return PATH_IMPORT_RE.test(source);
|
|
};
|