fastapi-rtk 0.2.23 → 0.2.25
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/dist/.bundled/jsonforms/cjs/_virtual/index10.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index6.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index7.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index8.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index9.cjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index10.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index6.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index7.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index8.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index9.mjs +2 -2
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/runtime/uri.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/applicator/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/core/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/format/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/validation/index.cjs +1 -1
- package/dist/.external/cjs/{fast-uri@3.0.6 → fast-uri@3.1.0}/fast-uri/index.cjs +51 -53
- package/dist/.external/cjs/fast-uri@3.1.0/fast-uri/lib/schemes.cjs +214 -0
- package/dist/.external/cjs/fast-uri@3.1.0/fast-uri/lib/utils.cjs +260 -0
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/runtime/uri.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/applicator/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/core/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/format/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/validation/index.mjs +1 -1
- package/dist/.external/esm/{fast-uri@3.0.6 → fast-uri@3.1.0}/fast-uri/index.mjs +51 -53
- package/dist/.external/esm/fast-uri@3.1.0/fast-uri/lib/schemes.mjs +214 -0
- package/dist/.external/esm/fast-uri@3.1.0/fast-uri/lib/utils.mjs +260 -0
- package/dist/core/cjs/Tables/NextGenDataGrid/NextGenDataGrid.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/FilterModeDescription.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/utils.cjs +8 -2
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useToolbar/basicToolbars.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useToolbarAlertBanner/FASTAPI_RTK_ToolbarAlertBanner.cjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/NextGenDataGrid.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/FilterModeDescription.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/utils.mjs +8 -2
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useToolbar/basicToolbars.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useToolbarAlertBanner/FASTAPI_RTK_ToolbarAlertBanner.mjs +1 -1
- package/package.json +1 -1
- package/dist/.external/cjs/fast-uri@3.0.6/fast-uri/lib/schemes.cjs +0 -149
- package/dist/.external/cjs/fast-uri@3.0.6/fast-uri/lib/scopedChars.cjs +0 -37
- package/dist/.external/cjs/fast-uri@3.0.6/fast-uri/lib/utils.cjs +0 -235
- package/dist/.external/esm/fast-uri@3.0.6/fast-uri/lib/schemes.mjs +0 -149
- package/dist/.external/esm/fast-uri@3.0.6/fast-uri/lib/scopedChars.mjs +0 -37
- package/dist/.external/esm/fast-uri@3.0.6/fast-uri/lib/utils.mjs +0 -235
- /package/dist/.external/cjs/{mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._ll5dfnmvjphm4bajaxt6oy7mty → mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._ug2uc7gqobpur37t5xiwwwh6ay}/mantine-react-table/dist/index.esm.cjs +0 -0
- /package/dist/.external/esm/{mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._ll5dfnmvjphm4bajaxt6oy7mty → mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._ug2uc7gqobpur37t5xiwwwh6ay}/mantine-react-table/dist/index.esm.mjs +0 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
var utils;
|
|
4
|
+
var hasRequiredUtils;
|
|
5
|
+
function requireUtils() {
|
|
6
|
+
if (hasRequiredUtils) return utils;
|
|
7
|
+
hasRequiredUtils = 1;
|
|
8
|
+
const isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
9
|
+
const isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
10
|
+
function stringArrayToHexStripped(input) {
|
|
11
|
+
let acc = "";
|
|
12
|
+
let code = 0;
|
|
13
|
+
let i = 0;
|
|
14
|
+
for (i = 0; i < input.length; i++) {
|
|
15
|
+
code = input[i].charCodeAt(0);
|
|
16
|
+
if (code === 48) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
|
|
20
|
+
return "";
|
|
21
|
+
}
|
|
22
|
+
acc += input[i];
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
for (i += 1; i < input.length; i++) {
|
|
26
|
+
code = input[i].charCodeAt(0);
|
|
27
|
+
if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
|
|
28
|
+
return "";
|
|
29
|
+
}
|
|
30
|
+
acc += input[i];
|
|
31
|
+
}
|
|
32
|
+
return acc;
|
|
33
|
+
}
|
|
34
|
+
const nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
|
|
35
|
+
function consumeIsZone(buffer) {
|
|
36
|
+
buffer.length = 0;
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
function consumeHextets(buffer, address, output) {
|
|
40
|
+
if (buffer.length) {
|
|
41
|
+
const hex = stringArrayToHexStripped(buffer);
|
|
42
|
+
if (hex !== "") {
|
|
43
|
+
address.push(hex);
|
|
44
|
+
} else {
|
|
45
|
+
output.error = true;
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
buffer.length = 0;
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
function getIPV6(input) {
|
|
53
|
+
let tokenCount = 0;
|
|
54
|
+
const output = { error: false, address: "", zone: "" };
|
|
55
|
+
const address = [];
|
|
56
|
+
const buffer = [];
|
|
57
|
+
let endipv6Encountered = false;
|
|
58
|
+
let endIpv6 = false;
|
|
59
|
+
let consume = consumeHextets;
|
|
60
|
+
for (let i = 0; i < input.length; i++) {
|
|
61
|
+
const cursor = input[i];
|
|
62
|
+
if (cursor === "[" || cursor === "]") {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (cursor === ":") {
|
|
66
|
+
if (endipv6Encountered === true) {
|
|
67
|
+
endIpv6 = true;
|
|
68
|
+
}
|
|
69
|
+
if (!consume(buffer, address, output)) {
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
if (++tokenCount > 7) {
|
|
73
|
+
output.error = true;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
if (i > 0 && input[i - 1] === ":") {
|
|
77
|
+
endipv6Encountered = true;
|
|
78
|
+
}
|
|
79
|
+
address.push(":");
|
|
80
|
+
continue;
|
|
81
|
+
} else if (cursor === "%") {
|
|
82
|
+
if (!consume(buffer, address, output)) {
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
consume = consumeIsZone;
|
|
86
|
+
} else {
|
|
87
|
+
buffer.push(cursor);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (buffer.length) {
|
|
92
|
+
if (consume === consumeIsZone) {
|
|
93
|
+
output.zone = buffer.join("");
|
|
94
|
+
} else if (endIpv6) {
|
|
95
|
+
address.push(buffer.join(""));
|
|
96
|
+
} else {
|
|
97
|
+
address.push(stringArrayToHexStripped(buffer));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
output.address = address.join("");
|
|
101
|
+
return output;
|
|
102
|
+
}
|
|
103
|
+
function normalizeIPv6(host) {
|
|
104
|
+
if (findToken(host, ":") < 2) {
|
|
105
|
+
return { host, isIPV6: false };
|
|
106
|
+
}
|
|
107
|
+
const ipv6 = getIPV6(host);
|
|
108
|
+
if (!ipv6.error) {
|
|
109
|
+
let newHost = ipv6.address;
|
|
110
|
+
let escapedHost = ipv6.address;
|
|
111
|
+
if (ipv6.zone) {
|
|
112
|
+
newHost += "%" + ipv6.zone;
|
|
113
|
+
escapedHost += "%25" + ipv6.zone;
|
|
114
|
+
}
|
|
115
|
+
return { host: newHost, isIPV6: true, escapedHost };
|
|
116
|
+
} else {
|
|
117
|
+
return { host, isIPV6: false };
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function findToken(str, token) {
|
|
121
|
+
let ind = 0;
|
|
122
|
+
for (let i = 0; i < str.length; i++) {
|
|
123
|
+
if (str[i] === token) ind++;
|
|
124
|
+
}
|
|
125
|
+
return ind;
|
|
126
|
+
}
|
|
127
|
+
function removeDotSegments(path) {
|
|
128
|
+
let input = path;
|
|
129
|
+
const output = [];
|
|
130
|
+
let nextSlash = -1;
|
|
131
|
+
let len = 0;
|
|
132
|
+
while (len = input.length) {
|
|
133
|
+
if (len === 1) {
|
|
134
|
+
if (input === ".") {
|
|
135
|
+
break;
|
|
136
|
+
} else if (input === "/") {
|
|
137
|
+
output.push("/");
|
|
138
|
+
break;
|
|
139
|
+
} else {
|
|
140
|
+
output.push(input);
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
} else if (len === 2) {
|
|
144
|
+
if (input[0] === ".") {
|
|
145
|
+
if (input[1] === ".") {
|
|
146
|
+
break;
|
|
147
|
+
} else if (input[1] === "/") {
|
|
148
|
+
input = input.slice(2);
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
} else if (input[0] === "/") {
|
|
152
|
+
if (input[1] === "." || input[1] === "/") {
|
|
153
|
+
output.push("/");
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
} else if (len === 3) {
|
|
158
|
+
if (input === "/..") {
|
|
159
|
+
if (output.length !== 0) {
|
|
160
|
+
output.pop();
|
|
161
|
+
}
|
|
162
|
+
output.push("/");
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (input[0] === ".") {
|
|
167
|
+
if (input[1] === ".") {
|
|
168
|
+
if (input[2] === "/") {
|
|
169
|
+
input = input.slice(3);
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
} else if (input[1] === "/") {
|
|
173
|
+
input = input.slice(2);
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
} else if (input[0] === "/") {
|
|
177
|
+
if (input[1] === ".") {
|
|
178
|
+
if (input[2] === "/") {
|
|
179
|
+
input = input.slice(2);
|
|
180
|
+
continue;
|
|
181
|
+
} else if (input[2] === ".") {
|
|
182
|
+
if (input[3] === "/") {
|
|
183
|
+
input = input.slice(3);
|
|
184
|
+
if (output.length !== 0) {
|
|
185
|
+
output.pop();
|
|
186
|
+
}
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if ((nextSlash = input.indexOf("/", 1)) === -1) {
|
|
193
|
+
output.push(input);
|
|
194
|
+
break;
|
|
195
|
+
} else {
|
|
196
|
+
output.push(input.slice(0, nextSlash));
|
|
197
|
+
input = input.slice(nextSlash);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return output.join("");
|
|
201
|
+
}
|
|
202
|
+
function normalizeComponentEncoding(component, esc) {
|
|
203
|
+
const func = esc !== true ? escape : unescape;
|
|
204
|
+
if (component.scheme !== void 0) {
|
|
205
|
+
component.scheme = func(component.scheme);
|
|
206
|
+
}
|
|
207
|
+
if (component.userinfo !== void 0) {
|
|
208
|
+
component.userinfo = func(component.userinfo);
|
|
209
|
+
}
|
|
210
|
+
if (component.host !== void 0) {
|
|
211
|
+
component.host = func(component.host);
|
|
212
|
+
}
|
|
213
|
+
if (component.path !== void 0) {
|
|
214
|
+
component.path = func(component.path);
|
|
215
|
+
}
|
|
216
|
+
if (component.query !== void 0) {
|
|
217
|
+
component.query = func(component.query);
|
|
218
|
+
}
|
|
219
|
+
if (component.fragment !== void 0) {
|
|
220
|
+
component.fragment = func(component.fragment);
|
|
221
|
+
}
|
|
222
|
+
return component;
|
|
223
|
+
}
|
|
224
|
+
function recomposeAuthority(component) {
|
|
225
|
+
const uriTokens = [];
|
|
226
|
+
if (component.userinfo !== void 0) {
|
|
227
|
+
uriTokens.push(component.userinfo);
|
|
228
|
+
uriTokens.push("@");
|
|
229
|
+
}
|
|
230
|
+
if (component.host !== void 0) {
|
|
231
|
+
let host = unescape(component.host);
|
|
232
|
+
if (!isIPv4(host)) {
|
|
233
|
+
const ipV6res = normalizeIPv6(host);
|
|
234
|
+
if (ipV6res.isIPV6 === true) {
|
|
235
|
+
host = `[${ipV6res.escapedHost}]`;
|
|
236
|
+
} else {
|
|
237
|
+
host = component.host;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
uriTokens.push(host);
|
|
241
|
+
}
|
|
242
|
+
if (typeof component.port === "number" || typeof component.port === "string") {
|
|
243
|
+
uriTokens.push(":");
|
|
244
|
+
uriTokens.push(String(component.port));
|
|
245
|
+
}
|
|
246
|
+
return uriTokens.length ? uriTokens.join("") : void 0;
|
|
247
|
+
}
|
|
248
|
+
utils = {
|
|
249
|
+
nonSimpleDomain,
|
|
250
|
+
recomposeAuthority,
|
|
251
|
+
normalizeComponentEncoding,
|
|
252
|
+
removeDotSegments,
|
|
253
|
+
isIPv4,
|
|
254
|
+
isUUID,
|
|
255
|
+
normalizeIPv6,
|
|
256
|
+
stringArrayToHexStripped
|
|
257
|
+
};
|
|
258
|
+
return utils;
|
|
259
|
+
}
|
|
260
|
+
exports.__require = requireUtils;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as compile } from "../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as compile } from "../../../../../../.bundled/jsonforms/esm/_virtual/index10.mjs";
|
|
2
2
|
import { __require as requireCodegen } from "./codegen/index.mjs";
|
|
3
3
|
import { __require as requireValidation_error } from "../runtime/validation_error.mjs";
|
|
4
4
|
import { __require as requireNames } from "./names.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __exports as uri } from "../../../../../../.bundled/jsonforms/esm/_virtual/uri.mjs";
|
|
2
|
-
import { __require as requireFastUri } from "../../../../fast-uri@3.0
|
|
2
|
+
import { __require as requireFastUri } from "../../../../fast-uri@3.1.0/fast-uri/index.mjs";
|
|
3
3
|
var hasRequiredUri;
|
|
4
4
|
function requireUri() {
|
|
5
5
|
if (hasRequiredUri) return uri;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as applicator } from "../../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as applicator } from "../../../../../../../.bundled/jsonforms/esm/_virtual/index8.mjs";
|
|
2
2
|
import { __require as requireAdditionalItems } from "./additionalItems.mjs";
|
|
3
3
|
import { __require as requirePrefixItems } from "./prefixItems.mjs";
|
|
4
4
|
import { __require as requireItems } from "./items.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as core } from "../../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as core } from "../../../../../../../.bundled/jsonforms/esm/_virtual/index6.mjs";
|
|
2
2
|
import { __require as requireId } from "./id.mjs";
|
|
3
3
|
import { __require as requireRef } from "./ref.mjs";
|
|
4
4
|
var hasRequiredCore;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as format } from "../../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as format } from "../../../../../../../.bundled/jsonforms/esm/_virtual/index9.mjs";
|
|
2
2
|
import { __require as requireFormat$1 } from "./format.mjs";
|
|
3
3
|
var hasRequiredFormat;
|
|
4
4
|
function requireFormat() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as validation } from "../../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as validation } from "../../../../../../../.bundled/jsonforms/esm/_virtual/index7.mjs";
|
|
2
2
|
import { __require as requireLimitNumber } from "./limitNumber.mjs";
|
|
3
3
|
import { __require as requireMultipleOf } from "./multipleOf.mjs";
|
|
4
4
|
import { __require as requireLimitLength } from "./limitLength.mjs";
|
|
@@ -5,22 +5,25 @@ var hasRequiredFastUri;
|
|
|
5
5
|
function requireFastUri() {
|
|
6
6
|
if (hasRequiredFastUri) return fastUri.exports;
|
|
7
7
|
hasRequiredFastUri = 1;
|
|
8
|
-
const { normalizeIPv6,
|
|
9
|
-
const SCHEMES = requireSchemes();
|
|
8
|
+
const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = requireUtils();
|
|
9
|
+
const { SCHEMES, getSchemeHandler } = requireSchemes();
|
|
10
10
|
function normalize(uri, options) {
|
|
11
11
|
if (typeof uri === "string") {
|
|
12
|
-
uri =
|
|
12
|
+
uri = /** @type {T} */
|
|
13
|
+
serialize(parse(uri, options), options);
|
|
13
14
|
} else if (typeof uri === "object") {
|
|
14
|
-
uri =
|
|
15
|
+
uri = /** @type {T} */
|
|
16
|
+
parse(serialize(uri, options), options);
|
|
15
17
|
}
|
|
16
18
|
return uri;
|
|
17
19
|
}
|
|
18
20
|
function resolve(baseURI, relativeURI, options) {
|
|
19
|
-
const schemelessOptions = Object.assign({ scheme: "null" }, options);
|
|
20
|
-
const resolved =
|
|
21
|
-
|
|
21
|
+
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
22
|
+
const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
23
|
+
schemelessOptions.skipEscape = true;
|
|
24
|
+
return serialize(resolved, schemelessOptions);
|
|
22
25
|
}
|
|
23
|
-
function
|
|
26
|
+
function resolveComponent(base, relative, options, skipNormalization) {
|
|
24
27
|
const target = {};
|
|
25
28
|
if (!skipNormalization) {
|
|
26
29
|
base = parse(serialize(base, options), options);
|
|
@@ -50,7 +53,7 @@ function requireFastUri() {
|
|
|
50
53
|
target.query = base.query;
|
|
51
54
|
}
|
|
52
55
|
} else {
|
|
53
|
-
if (relative.path
|
|
56
|
+
if (relative.path[0] === "/") {
|
|
54
57
|
target.path = removeDotSegments(relative.path);
|
|
55
58
|
} else {
|
|
56
59
|
if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
|
|
@@ -89,7 +92,7 @@ function requireFastUri() {
|
|
|
89
92
|
return uriA.toLowerCase() === uriB.toLowerCase();
|
|
90
93
|
}
|
|
91
94
|
function serialize(cmpts, opts) {
|
|
92
|
-
const
|
|
95
|
+
const component = {
|
|
93
96
|
host: cmpts.host,
|
|
94
97
|
scheme: cmpts.scheme,
|
|
95
98
|
userinfo: cmpts.userinfo,
|
|
@@ -107,60 +110,49 @@ function requireFastUri() {
|
|
|
107
110
|
};
|
|
108
111
|
const options = Object.assign({}, opts);
|
|
109
112
|
const uriTokens = [];
|
|
110
|
-
const schemeHandler =
|
|
111
|
-
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(
|
|
112
|
-
if (
|
|
113
|
+
const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
|
|
114
|
+
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
|
|
115
|
+
if (component.path !== void 0) {
|
|
113
116
|
if (!options.skipEscape) {
|
|
114
|
-
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
+
component.path = escape(component.path);
|
|
118
|
+
if (component.scheme !== void 0) {
|
|
119
|
+
component.path = component.path.split("%3A").join(":");
|
|
117
120
|
}
|
|
118
121
|
} else {
|
|
119
|
-
|
|
122
|
+
component.path = unescape(component.path);
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
|
-
if (options.reference !== "suffix" &&
|
|
123
|
-
uriTokens.push(
|
|
125
|
+
if (options.reference !== "suffix" && component.scheme) {
|
|
126
|
+
uriTokens.push(component.scheme, ":");
|
|
124
127
|
}
|
|
125
|
-
const authority = recomposeAuthority(
|
|
128
|
+
const authority = recomposeAuthority(component);
|
|
126
129
|
if (authority !== void 0) {
|
|
127
130
|
if (options.reference !== "suffix") {
|
|
128
131
|
uriTokens.push("//");
|
|
129
132
|
}
|
|
130
133
|
uriTokens.push(authority);
|
|
131
|
-
if (
|
|
134
|
+
if (component.path && component.path[0] !== "/") {
|
|
132
135
|
uriTokens.push("/");
|
|
133
136
|
}
|
|
134
137
|
}
|
|
135
|
-
if (
|
|
136
|
-
let s =
|
|
138
|
+
if (component.path !== void 0) {
|
|
139
|
+
let s = component.path;
|
|
137
140
|
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
138
141
|
s = removeDotSegments(s);
|
|
139
142
|
}
|
|
140
|
-
if (authority === void 0) {
|
|
141
|
-
s =
|
|
143
|
+
if (authority === void 0 && s[0] === "/" && s[1] === "/") {
|
|
144
|
+
s = "/%2F" + s.slice(2);
|
|
142
145
|
}
|
|
143
146
|
uriTokens.push(s);
|
|
144
147
|
}
|
|
145
|
-
if (
|
|
146
|
-
uriTokens.push("?",
|
|
148
|
+
if (component.query !== void 0) {
|
|
149
|
+
uriTokens.push("?", component.query);
|
|
147
150
|
}
|
|
148
|
-
if (
|
|
149
|
-
uriTokens.push("#",
|
|
151
|
+
if (component.fragment !== void 0) {
|
|
152
|
+
uriTokens.push("#", component.fragment);
|
|
150
153
|
}
|
|
151
154
|
return uriTokens.join("");
|
|
152
155
|
}
|
|
153
|
-
const hexLookUp = Array.from({ length: 127 }, (_v, k) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(k)));
|
|
154
|
-
function nonSimpleDomain(value) {
|
|
155
|
-
let code = 0;
|
|
156
|
-
for (let i = 0, len = value.length; i < len; ++i) {
|
|
157
|
-
code = value.charCodeAt(i);
|
|
158
|
-
if (code > 126 || hexLookUp[code]) {
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
return false;
|
|
163
|
-
}
|
|
164
156
|
const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
165
157
|
function parse(uri, opts) {
|
|
166
158
|
const options = Object.assign({}, opts);
|
|
@@ -173,9 +165,14 @@ function requireFastUri() {
|
|
|
173
165
|
query: void 0,
|
|
174
166
|
fragment: void 0
|
|
175
167
|
};
|
|
176
|
-
const gotEncoding = uri.indexOf("%") !== -1;
|
|
177
168
|
let isIP = false;
|
|
178
|
-
if (options.reference === "suffix")
|
|
169
|
+
if (options.reference === "suffix") {
|
|
170
|
+
if (options.scheme) {
|
|
171
|
+
uri = options.scheme + ":" + uri;
|
|
172
|
+
} else {
|
|
173
|
+
uri = "//" + uri;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
179
176
|
const matches = uri.match(URI_PARSE);
|
|
180
177
|
if (matches) {
|
|
181
178
|
parsed.scheme = matches[1];
|
|
@@ -189,13 +186,12 @@ function requireFastUri() {
|
|
|
189
186
|
parsed.port = matches[5];
|
|
190
187
|
}
|
|
191
188
|
if (parsed.host) {
|
|
192
|
-
const ipv4result =
|
|
193
|
-
if (ipv4result
|
|
194
|
-
const ipv6result = normalizeIPv6(
|
|
189
|
+
const ipv4result = isIPv4(parsed.host);
|
|
190
|
+
if (ipv4result === false) {
|
|
191
|
+
const ipv6result = normalizeIPv6(parsed.host);
|
|
195
192
|
parsed.host = ipv6result.host.toLowerCase();
|
|
196
193
|
isIP = ipv6result.isIPV6;
|
|
197
194
|
} else {
|
|
198
|
-
parsed.host = ipv4result.host;
|
|
199
195
|
isIP = true;
|
|
200
196
|
}
|
|
201
197
|
}
|
|
@@ -211,7 +207,7 @@ function requireFastUri() {
|
|
|
211
207
|
if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) {
|
|
212
208
|
parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
|
|
213
209
|
}
|
|
214
|
-
const schemeHandler =
|
|
210
|
+
const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
|
|
215
211
|
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
216
212
|
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
217
213
|
try {
|
|
@@ -222,11 +218,13 @@ function requireFastUri() {
|
|
|
222
218
|
}
|
|
223
219
|
}
|
|
224
220
|
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
225
|
-
if (
|
|
226
|
-
parsed.scheme
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
parsed.host
|
|
221
|
+
if (uri.indexOf("%") !== -1) {
|
|
222
|
+
if (parsed.scheme !== void 0) {
|
|
223
|
+
parsed.scheme = unescape(parsed.scheme);
|
|
224
|
+
}
|
|
225
|
+
if (parsed.host !== void 0) {
|
|
226
|
+
parsed.host = unescape(parsed.host);
|
|
227
|
+
}
|
|
230
228
|
}
|
|
231
229
|
if (parsed.path) {
|
|
232
230
|
parsed.path = escape(unescape(parsed.path));
|
|
@@ -247,7 +245,7 @@ function requireFastUri() {
|
|
|
247
245
|
SCHEMES,
|
|
248
246
|
normalize,
|
|
249
247
|
resolve,
|
|
250
|
-
|
|
248
|
+
resolveComponent,
|
|
251
249
|
equal,
|
|
252
250
|
serialize,
|
|
253
251
|
parse
|