• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

adobe / reactor-turbine / 26974271630

04 Jun 2026 07:23PM UTC coverage: 18.928% (-77.0%) from 95.912%
26974271630

Pull #201

github

web-flow
Merge 99f374fa8 into 4a42733a4
Pull Request #201: Platir 64071 update vulnerability chain

36 of 379 branches covered (9.5%)

Branch coverage included in aggregate %.

4 of 6 new or added lines in 1 file covered. (66.67%)

640 existing lines in 47 files now uncovered.

197 of 852 relevant lines covered (23.12%)

1.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

14.29
/src/resolveRelativePath.js
1
/***************************************************************************************
2
 * (c) 2017 Adobe. All rights reserved.
3
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
 * you may not use this file except in compliance with the License. You may obtain a copy
5
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
 *
7
 * Unless required by applicable law or agreed to in writing, software distributed under
8
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
 * OF ANY KIND, either express or implied. See the License for the specific language
10
 * governing permissions and limitations under the License.
11
 ****************************************************************************************/
12

13
var JS_EXTENSION = '.js';
3✔
14

15
/**
16
 * @private
17
 * Returns the directory of a path. A limited version of path.dirname in nodejs.
18
 *
19
 * To keep it simple, it makes the following assumptions:
20
 * path has a least one slash
21
 * path does not end with a slash
22
 * path does not have empty segments (e.g., /src/lib//foo.bar)
23
 *
24
 * @param {string} path
25
 * @returns {string}
26
 */
27
var dirname = function (path) {
3✔
UNCOV
28
  return path.substr(0, path.lastIndexOf('/'));
×
29
};
30

31
/**
32
 * Determines if a string ends with a certain string.
33
 * @param {string} str The string to test.
34
 * @param {string} suffix The suffix to look for at the end of str.
35
 * @returns {boolean} Whether str ends in suffix.
36
 */
37
var endsWith = function (str, suffix) {
3✔
UNCOV
38
  return str.indexOf(suffix, str.length - suffix.length) !== -1;
×
39
};
40

41
/**
42
 * Given a starting path and a path relative to the starting path, returns the final path. A
43
 * limited version of path.resolve in nodejs.
44
 *
45
 * To keep it simple, it makes the following assumptions:
46
 * fromPath has at least one slash
47
 * fromPath does not end with a slash.
48
 * fromPath does not have empty segments (e.g., /src/lib//foo.bar)
49
 * relativePath starts with ./ or ../
50
 *
51
 * @param {string} fromPath
52
 * @param {string} relativePath
53
 * @returns {string}
54
 */
55
module.exports = function (fromPath, relativePath) {
3✔
56
  // Handle the case where the relative path does not end in the .js extension. We auto-append it.
UNCOV
57
  if (!endsWith(relativePath, JS_EXTENSION)) {
×
UNCOV
58
    relativePath = relativePath + JS_EXTENSION;
×
59
  }
60

UNCOV
61
  var relativePathSegments = relativePath.split('/');
×
UNCOV
62
  var resolvedPathSegments = dirname(fromPath).split('/');
×
63

UNCOV
64
  relativePathSegments.forEach(function (relativePathSegment) {
×
UNCOV
65
    if (!relativePathSegment || relativePathSegment === '.') {
×
UNCOV
66
      return;
×
UNCOV
67
    } else if (relativePathSegment === '..') {
×
UNCOV
68
      if (resolvedPathSegments.length) {
×
UNCOV
69
        resolvedPathSegments.pop();
×
70
      }
71
    } else {
UNCOV
72
      resolvedPathSegments.push(relativePathSegment);
×
73
    }
74
  });
75

UNCOV
76
  return resolvedPathSegments.join('/');
×
77
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc