@parcel/utils 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +35876 -411
- package/lib/index.js.map +1 -0
- package/package.json +28 -15
- package/src/config.js +2 -2
- package/src/glob.js +14 -3
- package/src/index.js +1 -1
- package/src/replaceBundleReferences.js +3 -1
- package/lib/DefaultMap.js +0 -56
- package/lib/Deferred.js +0 -34
- package/lib/PromiseQueue.js +0 -124
- package/lib/TapStream.js +0 -41
- package/lib/alternatives.js +0 -134
- package/lib/ansi-html.js +0 -24
- package/lib/blob.js +0 -49
- package/lib/bundle-url.js +0 -43
- package/lib/collection.js +0 -65
- package/lib/config.js +0 -198
- package/lib/countLines.js +0 -18
- package/lib/debounce.js +0 -20
- package/lib/dependency-location.js +0 -21
- package/lib/escape-html.js +0 -24
- package/lib/generateBuildMetrics.js +0 -148
- package/lib/generateCertificate.js +0 -149
- package/lib/getCertificate.js +0 -19
- package/lib/getExisting.js +0 -31
- package/lib/getRootDir.js +0 -66
- package/lib/glob.js +0 -110
- package/lib/hash.js +0 -44
- package/lib/http-server.js +0 -102
- package/lib/is-url.js +0 -27
- package/lib/isDirectoryInside.js +0 -24
- package/lib/objectHash.js +0 -34
- package/lib/openInBrowser.js +0 -94
- package/lib/parseCSSImport.js +0 -16
- package/lib/path.js +0 -49
- package/lib/prettifyTime.js +0 -10
- package/lib/prettyDiagnostic.js +0 -139
- package/lib/relativeBundlePath.js +0 -30
- package/lib/relativeUrl.js +0 -32
- package/lib/replaceBundleReferences.js +0 -207
- package/lib/schema.js +0 -391
- package/lib/shared-buffer.js +0 -31
- package/lib/sourcemap.js +0 -147
- package/lib/stream.js +0 -86
- package/lib/throttle.js +0 -16
- package/lib/urlJoin.js +0 -46
package/lib/urlJoin.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = urlJoin;
|
|
7
|
-
|
|
8
|
-
function _url() {
|
|
9
|
-
const data = _interopRequireDefault(require("url"));
|
|
10
|
-
|
|
11
|
-
_url = function () {
|
|
12
|
-
return data;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
return data;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function _path() {
|
|
19
|
-
const data = _interopRequireDefault(require("path"));
|
|
20
|
-
|
|
21
|
-
_path = function () {
|
|
22
|
-
return data;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
return data;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Joins a path onto a URL, and normalizes Windows paths
|
|
32
|
-
* e.g. from \path\to\res.js to /path/to/res.js.
|
|
33
|
-
*/
|
|
34
|
-
function urlJoin(publicURL, assetPath) {
|
|
35
|
-
const url = _url().default.parse(publicURL, false, true); // Leading / ensures that paths with colons are not parsed as a protocol.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
let p = assetPath.startsWith('/') ? assetPath : '/' + assetPath;
|
|
39
|
-
|
|
40
|
-
const assetUrl = _url().default.parse(p);
|
|
41
|
-
|
|
42
|
-
url.pathname = _path().default.posix.join(url.pathname, assetUrl.pathname);
|
|
43
|
-
url.search = assetUrl.search;
|
|
44
|
-
url.hash = assetUrl.hash;
|
|
45
|
-
return _url().default.format(url);
|
|
46
|
-
}
|