source: imaps-frontend/node_modules/@nodelib/fs.walk/out/readers/common.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • 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.