exacturi 1.0.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/LICENSE.md +7 -0
- package/README.md +2 -0
- package/dist/cjs/errors.d.ts +11 -0
- package/dist/cjs/errors.d.ts.map +1 -0
- package/dist/cjs/errors.js +39 -0
- package/dist/cjs/errors.js.map +1 -0
- package/dist/cjs/exacturi.d.ts +91 -0
- package/dist/cjs/exacturi.d.ts.map +1 -0
- package/dist/cjs/exacturi.js +332 -0
- package/dist/cjs/exacturi.js.map +1 -0
- package/dist/cjs/index.d.ts +29 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +19 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/parts.d.ts +15 -0
- package/dist/cjs/parts.d.ts.map +1 -0
- package/dist/cjs/parts.js +3 -0
- package/dist/cjs/parts.js.map +1 -0
- package/dist/cjs/reuri.d.ts +92 -0
- package/dist/cjs/reuri.d.ts.map +1 -0
- package/dist/cjs/reuri.js +345 -0
- package/dist/cjs/reuri.js.map +1 -0
- package/dist/cjs/utils.d.ts +3 -0
- package/dist/cjs/utils.d.ts.map +1 -0
- package/dist/cjs/utils.js +45 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/esm/errors.d.ts +11 -0
- package/dist/esm/errors.d.ts.map +1 -0
- package/dist/esm/errors.js +28 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/exacturi.d.ts +91 -0
- package/dist/esm/exacturi.d.ts.map +1 -0
- package/dist/esm/exacturi.js +328 -0
- package/dist/esm/exacturi.js.map +1 -0
- package/dist/esm/index.d.ts +29 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/parts.d.ts +15 -0
- package/dist/esm/parts.d.ts.map +1 -0
- package/dist/esm/parts.js +2 -0
- package/dist/esm/parts.js.map +1 -0
- package/dist/esm/reuri.d.ts +92 -0
- package/dist/esm/reuri.d.ts.map +1 -0
- package/dist/esm/reuri.js +341 -0
- package/dist/esm/reuri.js.map +1 -0
- package/dist/esm/utils.d.ts +3 -0
- package/dist/esm/utils.d.ts.map +1 -0
- package/dist/esm/utils.js +41 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/lib/errors.d.ts +14 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +52 -0
- package/dist/lib/index.d.ts +31 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +20 -0
- package/dist/lib/parts.d.ts +18 -0
- package/dist/lib/parts.d.ts.map +1 -0
- package/dist/lib/parts.js +3 -0
- package/dist/lib/payload.d.ts +17 -0
- package/dist/lib/payload.d.ts.map +1 -0
- package/dist/lib/payload.js +126 -0
- package/dist/lib/reuri.d.ts +127 -0
- package/dist/lib/reuri.d.ts.map +1 -0
- package/dist/lib/reuri.js +457 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +26 -0
- package/dist/test/basic.test.js +319 -0
- package/dist/test/basic.test.js.map +1 -0
- package/dist/test/extras.test.js +77 -0
- package/dist/test/extras.test.js.map +1 -0
- package/dist/test/matching.test.js +80 -0
- package/dist/test/matching.test.js.map +1 -0
- package/package.json +101 -0
- package/src/errors.ts +31 -0
- package/src/exacturi.ts +444 -0
- package/src/index.ts +37 -0
- package/src/parts.ts +29 -0
- package/src/utils.ts +42 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2024 Greg Rosenbaum
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class ExactUriError extends Error {
|
|
2
|
+
name: string;
|
|
3
|
+
}
|
|
4
|
+
export declare function badInputError(input: any, reason: string): ExactUriError;
|
|
5
|
+
export declare function inputMustBeString(input: unknown): ExactUriError;
|
|
6
|
+
export declare function cantSerializeArtificialUrl(url: string): ExactUriError;
|
|
7
|
+
export declare function invalidCharacter(input: string, char: string, reason: string): ExactUriError;
|
|
8
|
+
export declare function portMustBeNumeric(input: string): ExactUriError;
|
|
9
|
+
export declare function inputMustBeUrl(input: string): ExactUriError;
|
|
10
|
+
export declare function cantCompareType(value: unknown): ExactUriError;
|
|
11
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAc,SAAQ,KAAK;IACpC,IAAI,SAAmB;CAC1B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,iBAEvD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,iBAE/C;AAED,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,iBAErD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAE3E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,iBAE9C;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,iBAE3C;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,iBAE7C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExactUriError = void 0;
|
|
4
|
+
exports.badInputError = badInputError;
|
|
5
|
+
exports.inputMustBeString = inputMustBeString;
|
|
6
|
+
exports.cantSerializeArtificialUrl = cantSerializeArtificialUrl;
|
|
7
|
+
exports.invalidCharacter = invalidCharacter;
|
|
8
|
+
exports.portMustBeNumeric = portMustBeNumeric;
|
|
9
|
+
exports.inputMustBeUrl = inputMustBeUrl;
|
|
10
|
+
exports.cantCompareType = cantCompareType;
|
|
11
|
+
class ExactUriError extends Error {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.name = "ExactUriError";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.ExactUriError = ExactUriError;
|
|
18
|
+
function badInputError(input, reason) {
|
|
19
|
+
return new ExactUriError(`Received bad input ${input}. ${reason}`);
|
|
20
|
+
}
|
|
21
|
+
function inputMustBeString(input) {
|
|
22
|
+
return badInputError(input, `Input must be a string, but was a ${typeof input}`);
|
|
23
|
+
}
|
|
24
|
+
function cantSerializeArtificialUrl(url) {
|
|
25
|
+
return new ExactUriError(`This URL is artificial and can't be serialized. Looks like: ${url}`);
|
|
26
|
+
}
|
|
27
|
+
function invalidCharacter(input, char, reason) {
|
|
28
|
+
return badInputError(input, `The character ${char} was unexpected because ${reason}.`);
|
|
29
|
+
}
|
|
30
|
+
function portMustBeNumeric(input) {
|
|
31
|
+
return badInputError(input, "Port must be numeric.");
|
|
32
|
+
}
|
|
33
|
+
function inputMustBeUrl(input) {
|
|
34
|
+
return badInputError(input, "Input failed to parse.");
|
|
35
|
+
}
|
|
36
|
+
function cantCompareType(value) {
|
|
37
|
+
return new ExactUriError(`Can't compare this URI to a value ${value}`);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";;;AAIA,sCAEC;AAED,8CAEC;AAED,gEAEC;AAED,4CAEC;AAED,8CAEC;AAED,wCAEC;AAED,0CAEC;AA9BD,MAAa,aAAc,SAAQ,KAAK;IAAxC;;QACI,SAAI,GAAG,eAAe,CAAC;IAC3B,CAAC;CAAA;AAFD,sCAEC;AAED,SAAgB,aAAa,CAAC,KAAU,EAAE,MAAc;IACpD,OAAO,IAAI,aAAa,CAAC,sBAAsB,KAAK,KAAK,MAAM,EAAE,CAAC,CAAC;AACvE,CAAC;AAED,SAAgB,iBAAiB,CAAC,KAAc;IAC5C,OAAO,aAAa,CAAC,KAAK,EAAE,qCAAqC,OAAO,KAAK,EAAE,CAAC,CAAC;AACrF,CAAC;AAED,SAAgB,0BAA0B,CAAC,GAAW;IAClD,OAAO,IAAI,aAAa,CAAC,+DAA+D,GAAG,EAAE,CAAC,CAAC;AACnG,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAa,EAAE,IAAY,EAAE,MAAc;IACxE,OAAO,aAAa,CAAC,KAAK,EAAE,iBAAiB,IAAI,2BAA2B,MAAM,GAAG,CAAC,CAAC;AAC3F,CAAC;AAED,SAAgB,iBAAiB,CAAC,KAAa;IAC3C,OAAO,aAAa,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC;AACzD,CAAC;AAED,SAAgB,cAAc,CAAC,KAAa;IACxC,OAAO,aAAa,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;AAC1D,CAAC;AAED,SAAgB,eAAe,CAAC,KAAc;IAC1C,OAAO,IAAI,aAAa,CAAC,qCAAqC,KAAK,EAAE,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ExactUri_Parts, ExactUri_PathKey, ExactUri_Protocol } from "./parts.js";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a URI and allows performing operations and inspecting it.
|
|
4
|
+
*
|
|
5
|
+
* This class is immutable.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ExactUri {
|
|
8
|
+
private _protocol;
|
|
9
|
+
private _hostname;
|
|
10
|
+
private _path;
|
|
11
|
+
private _query;
|
|
12
|
+
private _hash;
|
|
13
|
+
private _parsed;
|
|
14
|
+
private _port;
|
|
15
|
+
constructor(_protocol: ExactUri_Protocol | undefined, _hostname: string | undefined, _path: string, _query: string | undefined, _hash: string | undefined, _parsed: string | undefined, _port: string | undefined);
|
|
16
|
+
static is(other: unknown): other is ExactUri;
|
|
17
|
+
segments(): string[];
|
|
18
|
+
segments(overwrite: string[]): ExactUri;
|
|
19
|
+
merge(other: string): ExactUri;
|
|
20
|
+
merge(other: ExactUri): ExactUri;
|
|
21
|
+
pick(...keys: ExactUri_PathKey[]): ExactUri;
|
|
22
|
+
parts(): ExactUri_Parts;
|
|
23
|
+
parts(overwrite: Partial<ExactUri_Parts>): ExactUri;
|
|
24
|
+
part(key: ExactUri_PathKey): string | undefined;
|
|
25
|
+
part(key: ExactUri_PathKey, value: string | undefined): ExactUri;
|
|
26
|
+
address(address: string | undefined | null): ExactUri;
|
|
27
|
+
address(): string | undefined;
|
|
28
|
+
resource(resource: string | undefined | null): ExactUri;
|
|
29
|
+
resource(): string | undefined;
|
|
30
|
+
origin(origin: string | undefined | null): ExactUri;
|
|
31
|
+
origin(): string | undefined;
|
|
32
|
+
segment(index: number): string;
|
|
33
|
+
segment(index: number, value: string): ExactUri;
|
|
34
|
+
path(): string;
|
|
35
|
+
path(path: string | undefined | null): ExactUri;
|
|
36
|
+
port(): number | undefined;
|
|
37
|
+
port(raw: true): string | undefined;
|
|
38
|
+
port(port: number | undefined | string | null): ExactUri;
|
|
39
|
+
protocol(): ExactUri_Protocol | undefined;
|
|
40
|
+
protocol(proto: ExactUri_Protocol | null | undefined): ExactUri;
|
|
41
|
+
host(): string | undefined;
|
|
42
|
+
host(host: string | undefined | null): ExactUri;
|
|
43
|
+
hostname(): string | undefined;
|
|
44
|
+
hostname(hostname: string | undefined | null): ExactUri;
|
|
45
|
+
query(): string | undefined;
|
|
46
|
+
query(query: string | null | undefined): ExactUri;
|
|
47
|
+
hash(): string;
|
|
48
|
+
hash(hash: string | null | undefined): ExactUri;
|
|
49
|
+
private _noCopyClone;
|
|
50
|
+
get isWeb(): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Gets a clone of this instance.
|
|
53
|
+
*/
|
|
54
|
+
clone(): ExactUri;
|
|
55
|
+
static empty(): ExactUri;
|
|
56
|
+
static parse(input: null | undefined): ExactUri;
|
|
57
|
+
static parse(input: string | ExactUri | Partial<ExactUri_Parts>): ExactUri;
|
|
58
|
+
/**
|
|
59
|
+
* Checks if this URI (CHILD) matches another URI (PARENT). The parent can be a string,
|
|
60
|
+
* an {@link ExactUri}, or an object describing the parts of a URI -- an {@link ExactUri_Parts}.
|
|
61
|
+
*
|
|
62
|
+
* CHILD is considered to be a child of PARENT if:
|
|
63
|
+
* 1. If PARENT has a protocol, it must equal CHILD protocol.
|
|
64
|
+
* 2. If PARENT has a hostname, it must be a parent of CHILD's hostname.
|
|
65
|
+
* 3. If PARENT has a port, it must equal CHILD's port.
|
|
66
|
+
* 4. If PARENT has a path, it must be a parent of CHILD's path.
|
|
67
|
+
* 5. If PARENT has a query, it must equal CHILD's query.
|
|
68
|
+
* 6. If PARENT has a hash, it must equal CHILD's hash.
|
|
69
|
+
* @param parent The parent URI to check against.
|
|
70
|
+
*/
|
|
71
|
+
matches(parent: Partial<ExactUri_Parts> | ExactUri | string): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Checks if this URI equals another URI, which can be given as a string, an
|
|
74
|
+
* {@link ExactUri}, or an object describing the parts of a URI -- an {@link ExactUri_Parts}.
|
|
75
|
+
* @param other The other URI to check against.
|
|
76
|
+
*/
|
|
77
|
+
equal(other: string | ExactUri | Partial<ExactUri_Parts>): boolean;
|
|
78
|
+
get isArtificial(): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Does this URL have a non-web protocol?
|
|
81
|
+
*/
|
|
82
|
+
get isNonWeb(): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Gets the full URI.
|
|
85
|
+
*/
|
|
86
|
+
get href(): string;
|
|
87
|
+
private _print;
|
|
88
|
+
get [Symbol.toStringTag](): string;
|
|
89
|
+
toString(): string;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=exacturi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exacturi.d.ts","sourceRoot":"","sources":["../../src/exacturi.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACpB,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,qBAAa,QAAQ;IAIb,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,KAAK;gBANL,SAAS,EAAE,iBAAiB,GAAG,SAAS,EACxC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,MAAM,GAAG,SAAS;IAGrC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ;IAI5C,QAAQ,IAAI,MAAM,EAAE;IACpB,QA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AED,QAAQ;CAGX"}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExactUri = void 0;
|
|
4
|
+
const errors_js_1 = require("./errors.js");
|
|
5
|
+
const utils_js_1 = require("./utils.js");
|
|
6
|
+
/**
|
|
7
|
+
* Represents a URI and allows performing operations and inspecting it.
|
|
8
|
+
*
|
|
9
|
+
* This class is immutable.
|
|
10
|
+
*/
|
|
11
|
+
class ExactUri {
|
|
12
|
+
// Lots of params needed here
|
|
13
|
+
// eslint-disable-next-line max-params
|
|
14
|
+
constructor(_protocol, _hostname, _path, _query, _hash, _parsed, _port) {
|
|
15
|
+
this._protocol = _protocol;
|
|
16
|
+
this._hostname = _hostname;
|
|
17
|
+
this._path = _path;
|
|
18
|
+
this._query = _query;
|
|
19
|
+
this._hash = _hash;
|
|
20
|
+
this._parsed = _parsed;
|
|
21
|
+
this._port = _port;
|
|
22
|
+
}
|
|
23
|
+
static is(other) {
|
|
24
|
+
return !!(other && typeof other === "object" && other.constructor === ExactUri);
|
|
25
|
+
}
|
|
26
|
+
segments(overwrite) {
|
|
27
|
+
if (arguments.length === 0) {
|
|
28
|
+
return this._path.split("/");
|
|
29
|
+
}
|
|
30
|
+
const clone = this._noCopyClone();
|
|
31
|
+
clone._path = overwrite.join("/");
|
|
32
|
+
return clone;
|
|
33
|
+
}
|
|
34
|
+
merge(other) {
|
|
35
|
+
if (typeof other === "string") {
|
|
36
|
+
return this.merge(ExactUri.parse(other));
|
|
37
|
+
}
|
|
38
|
+
return this.parts({
|
|
39
|
+
hash: other._hash || this._hash,
|
|
40
|
+
hostname: other._hostname || this._hostname,
|
|
41
|
+
path: other._path || this._path,
|
|
42
|
+
port: other._port || this._port,
|
|
43
|
+
protocol: other._protocol || this._protocol,
|
|
44
|
+
query: other._query || this._query
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
pick(...keys) {
|
|
48
|
+
let result = ExactUri.empty();
|
|
49
|
+
for (const key of keys) {
|
|
50
|
+
result = result.part(key, this.part(key));
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
parts(overwrite) {
|
|
55
|
+
if (arguments.length === 0) {
|
|
56
|
+
return {
|
|
57
|
+
protocol: this._protocol,
|
|
58
|
+
hostname: this._hostname,
|
|
59
|
+
port: this._port,
|
|
60
|
+
path: this._path,
|
|
61
|
+
query: this._query,
|
|
62
|
+
hash: this._hash
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (!overwrite) {
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
const clone = this._noCopyClone();
|
|
69
|
+
clone._protocol = "protocol" in overwrite ? overwrite.protocol : clone._protocol;
|
|
70
|
+
clone._hostname = "hostname" in overwrite ? overwrite.hostname : clone._hostname;
|
|
71
|
+
clone._port = "port" in overwrite ? overwrite.port : clone._port;
|
|
72
|
+
clone._path = "path" in overwrite ? overwrite.path : clone._path;
|
|
73
|
+
clone._query = "query" in overwrite ? overwrite.query : clone._query;
|
|
74
|
+
clone._hash = "hash" in overwrite ? overwrite.hash : clone._hash;
|
|
75
|
+
return clone;
|
|
76
|
+
}
|
|
77
|
+
part(key, value) {
|
|
78
|
+
if (arguments.length === 1) {
|
|
79
|
+
const result = this[key]();
|
|
80
|
+
return result != null ? String(result) : undefined;
|
|
81
|
+
}
|
|
82
|
+
return this[key](value);
|
|
83
|
+
}
|
|
84
|
+
address(address) {
|
|
85
|
+
if (arguments.length === 1) {
|
|
86
|
+
const parsed = ExactUri.parse(address);
|
|
87
|
+
return parsed.parts({
|
|
88
|
+
protocol: this._protocol
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return this.parts({
|
|
92
|
+
protocol: undefined
|
|
93
|
+
}).href;
|
|
94
|
+
}
|
|
95
|
+
resource(resource) {
|
|
96
|
+
if (arguments.length === 1) {
|
|
97
|
+
const parsed = ExactUri.parse(resource);
|
|
98
|
+
return parsed.parts({
|
|
99
|
+
protocol: this._protocol,
|
|
100
|
+
hostname: this._hostname,
|
|
101
|
+
port: this._port
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return this.parts({
|
|
105
|
+
protocol: undefined,
|
|
106
|
+
hostname: undefined,
|
|
107
|
+
port: undefined
|
|
108
|
+
}).href;
|
|
109
|
+
}
|
|
110
|
+
origin(origin) {
|
|
111
|
+
if (arguments.length === 1) {
|
|
112
|
+
const parsed = ExactUri.parse(origin);
|
|
113
|
+
return this.parts({
|
|
114
|
+
protocol: parsed._protocol,
|
|
115
|
+
hostname: parsed._hostname,
|
|
116
|
+
port: parsed._port
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
const parts = this.parts();
|
|
120
|
+
return (ExactUri.empty().parts({
|
|
121
|
+
protocol: parts.protocol,
|
|
122
|
+
hostname: parts.hostname,
|
|
123
|
+
port: parts.port
|
|
124
|
+
}).href || undefined);
|
|
125
|
+
}
|
|
126
|
+
segment(index, value) {
|
|
127
|
+
if (arguments.length === 0) {
|
|
128
|
+
throw new errors_js_1.ExactUriError(`You must provide an index.`);
|
|
129
|
+
}
|
|
130
|
+
if (arguments.length === 1) {
|
|
131
|
+
return this._path.split("/")[index];
|
|
132
|
+
}
|
|
133
|
+
const segments = this.segments();
|
|
134
|
+
segments[index] = value;
|
|
135
|
+
return this.segments(segments);
|
|
136
|
+
}
|
|
137
|
+
path(path) {
|
|
138
|
+
if (arguments.length === 0) {
|
|
139
|
+
return this._path;
|
|
140
|
+
}
|
|
141
|
+
const clone = this._noCopyClone();
|
|
142
|
+
clone._path = path ?? "";
|
|
143
|
+
return clone;
|
|
144
|
+
}
|
|
145
|
+
port(port) {
|
|
146
|
+
if (arguments.length === 0) {
|
|
147
|
+
return this._port != null ? Number(this._port) : undefined;
|
|
148
|
+
}
|
|
149
|
+
if (port === true) {
|
|
150
|
+
return this._port;
|
|
151
|
+
}
|
|
152
|
+
const clone = this._noCopyClone();
|
|
153
|
+
clone._port = port != null ? String(port) : undefined;
|
|
154
|
+
return clone;
|
|
155
|
+
}
|
|
156
|
+
protocol(proto) {
|
|
157
|
+
if (arguments.length === 0) {
|
|
158
|
+
return this._protocol;
|
|
159
|
+
}
|
|
160
|
+
const clone = this._noCopyClone();
|
|
161
|
+
clone._protocol = proto ?? undefined;
|
|
162
|
+
return clone;
|
|
163
|
+
}
|
|
164
|
+
host(host) {
|
|
165
|
+
if (arguments.length === 0) {
|
|
166
|
+
return (ExactUri.empty().hostname(this._hostname).port(this._port).href.slice(2) ||
|
|
167
|
+
undefined);
|
|
168
|
+
}
|
|
169
|
+
if (host == null) {
|
|
170
|
+
return this.hostname(null).port(null);
|
|
171
|
+
}
|
|
172
|
+
const parsed = ExactUri.parse(`//${host}`);
|
|
173
|
+
return this.hostname(parsed._hostname).port(parsed._port);
|
|
174
|
+
}
|
|
175
|
+
hostname(hostname) {
|
|
176
|
+
if (arguments.length === 0) {
|
|
177
|
+
return this._hostname;
|
|
178
|
+
}
|
|
179
|
+
const clone = this._noCopyClone();
|
|
180
|
+
clone._hostname = hostname ?? undefined;
|
|
181
|
+
return clone;
|
|
182
|
+
}
|
|
183
|
+
query(query) {
|
|
184
|
+
if (arguments.length === 0) {
|
|
185
|
+
return this._query;
|
|
186
|
+
}
|
|
187
|
+
const clone = this._noCopyClone();
|
|
188
|
+
clone._query = query ?? undefined;
|
|
189
|
+
return clone;
|
|
190
|
+
}
|
|
191
|
+
hash(hash) {
|
|
192
|
+
if (arguments.length === 0) {
|
|
193
|
+
return this._hash;
|
|
194
|
+
}
|
|
195
|
+
const clone = this._noCopyClone();
|
|
196
|
+
clone._hash = hash ?? undefined;
|
|
197
|
+
return clone;
|
|
198
|
+
}
|
|
199
|
+
_noCopyClone() {
|
|
200
|
+
return new ExactUri(this._protocol, this._hostname, this._path, this._query, this._hash, this._parsed, this._port);
|
|
201
|
+
}
|
|
202
|
+
// Does this URL have a web protocol?
|
|
203
|
+
get isWeb() {
|
|
204
|
+
return !!this._protocol && webProtocols.has(this._protocol);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Gets a clone of this instance.
|
|
208
|
+
*/
|
|
209
|
+
clone() {
|
|
210
|
+
return new ExactUri(this._protocol, this._hostname, this._path, this._query, this._hash, this._parsed, this._port);
|
|
211
|
+
}
|
|
212
|
+
static empty() {
|
|
213
|
+
return new ExactUri(undefined, undefined, "", undefined, undefined, undefined, undefined);
|
|
214
|
+
}
|
|
215
|
+
static parse(input) {
|
|
216
|
+
if (input == null) {
|
|
217
|
+
return ExactUri.empty();
|
|
218
|
+
}
|
|
219
|
+
if (input instanceof ExactUri) {
|
|
220
|
+
return input;
|
|
221
|
+
}
|
|
222
|
+
if (typeof input === "object") {
|
|
223
|
+
return ExactUri.empty().parts(input);
|
|
224
|
+
}
|
|
225
|
+
if (typeof input !== "string") {
|
|
226
|
+
throw (0, errors_js_1.inputMustBeString)(input);
|
|
227
|
+
}
|
|
228
|
+
const r = urlRegexp.exec(input);
|
|
229
|
+
if (!r) {
|
|
230
|
+
throw (0, errors_js_1.inputMustBeUrl)(input);
|
|
231
|
+
}
|
|
232
|
+
const [, proto, hostname, port, path, query, fragment] = r;
|
|
233
|
+
if (port != null && (Number.isNaN(+port) || port === "")) {
|
|
234
|
+
throw (0, errors_js_1.portMustBeNumeric)(input);
|
|
235
|
+
}
|
|
236
|
+
return new ExactUri(proto?.trim(), hostname?.trim(), path?.trim() ?? "", query?.trim(), fragment?.trim(), input, port);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Checks if this URI (CHILD) matches another URI (PARENT). The parent can be a string,
|
|
240
|
+
* an {@link ExactUri}, or an object describing the parts of a URI -- an {@link ExactUri_Parts}.
|
|
241
|
+
*
|
|
242
|
+
* CHILD is considered to be a child of PARENT if:
|
|
243
|
+
* 1. If PARENT has a protocol, it must equal CHILD protocol.
|
|
244
|
+
* 2. If PARENT has a hostname, it must be a parent of CHILD's hostname.
|
|
245
|
+
* 3. If PARENT has a port, it must equal CHILD's port.
|
|
246
|
+
* 4. If PARENT has a path, it must be a parent of CHILD's path.
|
|
247
|
+
* 5. If PARENT has a query, it must equal CHILD's query.
|
|
248
|
+
* 6. If PARENT has a hash, it must equal CHILD's hash.
|
|
249
|
+
* @param parent The parent URI to check against.
|
|
250
|
+
*/
|
|
251
|
+
matches(parent) {
|
|
252
|
+
parent = ExactUri.parse(parent);
|
|
253
|
+
if (parent._protocol && parent._protocol !== this._protocol) {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
if (parent._hostname && !(0, utils_js_1.hostnameContains)(this._hostname, parent._hostname)) {
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
if (parent._port && parent._port !== this._port) {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
if (parent._query && parent._query !== this._query) {
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
if (parent._hash && parent._hash !== this._hash) {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
const parentSegments = parent.segments();
|
|
269
|
+
const childSegments = this.segments();
|
|
270
|
+
for (let i = 0; i < parentSegments.length; i++) {
|
|
271
|
+
if (parentSegments[i] !== childSegments[i]) {
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Checks if this URI equals another URI, which can be given as a string, an
|
|
279
|
+
* {@link ExactUri}, or an object describing the parts of a URI -- an {@link ExactUri_Parts}.
|
|
280
|
+
* @param other The other URI to check against.
|
|
281
|
+
*/
|
|
282
|
+
equal(other) {
|
|
283
|
+
if (this === other) {
|
|
284
|
+
return true;
|
|
285
|
+
}
|
|
286
|
+
other = ExactUri.parse(other);
|
|
287
|
+
const myParts = this.parts();
|
|
288
|
+
const otherParts = other.parts();
|
|
289
|
+
for (const key of ["protocol", "hostname", "port", "path", "query", "hash"]) {
|
|
290
|
+
if (myParts[key] !== otherParts[key]) {
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return true;
|
|
295
|
+
}
|
|
296
|
+
// An artificial URI is one that can't have been parsed from a string due to an invalid combination of components.
|
|
297
|
+
get isArtificial() {
|
|
298
|
+
return !ExactUri.parse(this._print()).equal(this);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Does this URL have a non-web protocol?
|
|
302
|
+
*/
|
|
303
|
+
get isNonWeb() {
|
|
304
|
+
return !!this._protocol && !webProtocols.has(this._protocol);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Gets the full URI.
|
|
308
|
+
*/
|
|
309
|
+
get href() {
|
|
310
|
+
return this._print();
|
|
311
|
+
}
|
|
312
|
+
_print() {
|
|
313
|
+
let { _protocol, _hostname, _query, _hash } = this;
|
|
314
|
+
const { _port } = this;
|
|
315
|
+
_protocol = _protocol != null ? `${_protocol}:` : _protocol;
|
|
316
|
+
_hostname = _hostname != null ? `//${_hostname}` : "";
|
|
317
|
+
_query = _query != null ? `?${_query}` : "";
|
|
318
|
+
_hash = _hash != null ? `#${_hash}` : "";
|
|
319
|
+
const strPort = _port != null ? `:${_port}` : "";
|
|
320
|
+
return [_protocol, _hostname, strPort, this._path, _query, _hash].join("");
|
|
321
|
+
}
|
|
322
|
+
get [Symbol.toStringTag]() {
|
|
323
|
+
return this.href;
|
|
324
|
+
}
|
|
325
|
+
toString() {
|
|
326
|
+
return this.href;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
exports.ExactUri = ExactUri;
|
|
330
|
+
const urlRegexp = /^(?:([a-zA-Z][A-Za-z\d+-.]*):)?(?:\/\/([^/?#:]*)(?::([^/?#]*))?)?([^?#]*)?(?:\?([^#]*))?(?:#(.*))?$/;
|
|
331
|
+
const webProtocols = new Set(["http", "ws", "https", "wss"]);
|
|
332
|
+
//# sourceMappingURL=exacturi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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EAAE,CAAC;QAC5C,KAAK,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;CACJ;AAxaD,4BAwaC;AAED,MAAM,SAAS,GACX,qGAAqG,CAAC;AAE1G,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ExactUri } from "./exacturi.js";
|
|
2
|
+
import { ExactUri_Parts } from "./parts.js";
|
|
3
|
+
export { ExactUri } from "./exacturi.js";
|
|
4
|
+
/**
|
|
5
|
+
* Creates an empty ExactUri object.
|
|
6
|
+
*/
|
|
7
|
+
export declare function exacturi(): ExactUri;
|
|
8
|
+
/**
|
|
9
|
+
* Creates an ExactUri object from an {@link ExactUri_Parts} describing the parts of the URI.
|
|
10
|
+
* @param parts The parts of the URI.
|
|
11
|
+
*/
|
|
12
|
+
export declare function exacturi(parts: Partial<ExactUri_Parts>): ExactUri;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the same ExactUri object that was passed in.
|
|
15
|
+
* @param uri
|
|
16
|
+
*/
|
|
17
|
+
export declare function exacturi(uri: ExactUri): ExactUri;
|
|
18
|
+
/**
|
|
19
|
+
* Parses a string into an ExactUri object.
|
|
20
|
+
* @param uri The string to parse.
|
|
21
|
+
*/
|
|
22
|
+
export declare function exacturi(uri: string): ExactUri;
|
|
23
|
+
/**
|
|
24
|
+
* Returns true if the given value is an ExactUri object.
|
|
25
|
+
* @param uri The value to check.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isExactUri(uri: unknown): uri is ExactUri;
|
|
28
|
+
export { ExactUri_Protocol } from "./parts.js";
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,wBAAgB,QAAQ,IAAI,QAAQ,CAAC;AACrC;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,QAAQ,CAAC;AACnE;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAAC;AAClD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC;AAKhD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,QAAQ,CAExD;AACD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExactUri = void 0;
|
|
4
|
+
exports.exacturi = exacturi;
|
|
5
|
+
exports.isExactUri = isExactUri;
|
|
6
|
+
const exacturi_js_1 = require("./exacturi.js");
|
|
7
|
+
var exacturi_js_2 = require("./exacturi.js");
|
|
8
|
+
Object.defineProperty(exports, "ExactUri", { enumerable: true, get: function () { return exacturi_js_2.ExactUri; } });
|
|
9
|
+
function exacturi(uri) {
|
|
10
|
+
return exacturi_js_1.ExactUri.parse(uri);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Returns true if the given value is an ExactUri object.
|
|
14
|
+
* @param uri The value to check.
|
|
15
|
+
*/
|
|
16
|
+
function isExactUri(uri) {
|
|
17
|
+
return exacturi_js_1.ExactUri.is(uri);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAyBA,4BAEC;AAMD,gCAEC;AAnCD,+CAAyC;AAIzC,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AAqBjB,SAAgB,QAAQ,CAAC,GAAiD;IACtE,OAAO,sBAAQ,CAAC,KAAK,CAAC,GAAU,CAAC,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,SAAgB,UAAU,CAAC,GAAY;IACnC,OAAO,sBAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ExactUri_Protocol = "http" | "https" | "ws" | "wss" | "about" | "chrome" | "chrome-extension" | "data" | "blob" | "javascript" | "file" | "ftp" | string;
|
|
2
|
+
export type ExactUri_CompoundNames = "host" | "origin" | "resource" | "address";
|
|
3
|
+
export type ExactUri_PathKey = keyof ExactUri_Parts | ExactUri_CompoundNames;
|
|
4
|
+
/**
|
|
5
|
+
* Describes the parts of a URI.
|
|
6
|
+
*/
|
|
7
|
+
export interface ExactUri_Parts {
|
|
8
|
+
protocol?: ExactUri_Protocol;
|
|
9
|
+
hostname?: string;
|
|
10
|
+
port?: string;
|
|
11
|
+
path: string;
|
|
12
|
+
query?: string;
|
|
13
|
+
hash?: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=parts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../../src/parts.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,iBAAiB,GACvB,MAAM,GACN,OAAO,GACP,IAAI,GACJ,KAAK,GACL,OAAO,GACP,QAAQ,GACR,kBAAkB,GAClB,MAAM,GACN,MAAM,GACN,YAAY,GACZ,MAAM,GACN,KAAK,GACL,MAAM,CAAC;AACb,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,MAAM,cAAc,GAAG,sBAAsB,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parts.js","sourceRoot":"","sources":["../../src/parts.ts"],"names":[],"mappings":""}
|