source: trip-planner-front/node_modules/@nodelib/fs.walk/out/readers/common.js@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.0 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
4function isFatalError(settings, error) {
5 if (settings.errorFilter === null) {
6 return true;
7 }
8 return !settings.errorFilter(error);
9}
10exports.isFatalError = isFatalError;
11function isAppliedFilter(filter, value) {
12 return filter === null || filter(value);
13}
14exports.isAppliedFilter = isAppliedFilter;
15function replacePathSegmentSeparator(filepath, separator) {
16 return filepath.split(/[/\\]/).join(separator);
17}
18exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
19function joinPathSegments(a, b, separator) {
20 if (a === '') {
21 return b;
22 }
23 /**
24 * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
25 */
26 if (a.endsWith(separator)) {
27 return a + b;
28 }
29 return a + separator + b;
30}
31exports.joinPathSegments = joinPathSegments;
Note: See TracBrowser for help on using the repository browser.