Last change
on this file since 6a80231 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
823 bytes
|
Line | |
---|
1 | /*
|
---|
2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
3 | Author Tobias Koppers @sokra
|
---|
4 | */
|
---|
5 |
|
---|
6 | "use strict";
|
---|
7 |
|
---|
8 | module.exports = function getInnerRequest(resolver, request) {
|
---|
9 | if (
|
---|
10 | typeof request.__innerRequest === "string" &&
|
---|
11 | request.__innerRequest_request === request.request &&
|
---|
12 | request.__innerRequest_relativePath === request.relativePath
|
---|
13 | )
|
---|
14 | return request.__innerRequest;
|
---|
15 | let innerRequest;
|
---|
16 | if (request.request) {
|
---|
17 | innerRequest = request.request;
|
---|
18 | if (/^\.\.?(?:\/|$)/.test(innerRequest) && request.relativePath) {
|
---|
19 | innerRequest = resolver.join(request.relativePath, innerRequest);
|
---|
20 | }
|
---|
21 | } else {
|
---|
22 | innerRequest = request.relativePath;
|
---|
23 | }
|
---|
24 | request.__innerRequest_request = request.request;
|
---|
25 | request.__innerRequest_relativePath = request.relativePath;
|
---|
26 | return (request.__innerRequest = innerRequest);
|
---|
27 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.