@oozcitak/url 0.0.7 → 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/README.md +14 -0
- package/lib/URLAlgorithm.d.ts +267 -321
- package/lib/URLAlgorithm.js +2217 -2184
- package/lib/URLAlgorithm.js.map +1 -1
- package/lib/URLImpl.d.ts +22 -14
- package/lib/URLImpl.js +24 -25
- package/lib/URLImpl.js.map +1 -1
- package/lib/URLSearchParamsImpl.d.ts +0 -2
- package/lib/URLSearchParamsImpl.js +4 -5
- package/lib/URLSearchParamsImpl.js.map +1 -1
- package/lib/index.d.ts +2 -4
- package/lib/index.js +4 -15
- package/lib/index.js.map +1 -1
- package/package.json +5 -5
- package/lib/IDNAMappingTable.d.ts +0 -41
- package/lib/IDNAMappingTable.js +0 -8688
- package/lib/IDNAMappingTable.js.map +0 -1
- package/lib/TreeMap.d.ts +0 -39
- package/lib/TreeMap.js +0 -105
- package/lib/TreeMap.js.map +0 -1
- package/lib/algorithm/URLAlgorithm.d.ts +0 -321
- package/lib/algorithm/URLAlgorithm.js +0 -2552
- package/lib/algorithm/URLAlgorithm.js.map +0 -1
- package/lib/algorithm/index.d.ts +0 -1
- package/lib/algorithm/index.js +0 -5
- package/lib/algorithm/index.js.map +0 -1
- package/lib/interfacesInternal.d.ts +0 -22
- package/lib/interfacesInternal.js +0 -3
- package/lib/interfacesInternal.js.map +0 -1
- package/lib/url/URLImpl.d.ts +0 -45
- package/lib/url/URLImpl.js +0 -329
- package/lib/url/URLImpl.js.map +0 -1
- package/lib/url/URLSearchParamsImpl.d.ts +0 -40
- package/lib/url/URLSearchParamsImpl.js +0 -184
- package/lib/url/URLSearchParamsImpl.js.map +0 -1
- package/lib/url/index.d.ts +0 -4
- package/lib/url/index.js +0 -16
- package/lib/url/index.js.map +0 -1
- package/lib/url/interfaces.d.ts +0 -195
- package/lib/url/interfaces.js +0 -31
- package/lib/url/interfaces.js.map +0 -1
- package/lib/util/StringWalker.d.ts +0 -48
- package/lib/util/StringWalker.js +0 -92
- package/lib/util/StringWalker.js.map +0 -1
- package/lib/util/index.d.ts +0 -59
- package/lib/util/index.js +0 -170
- package/lib/util/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -11,3 +11,17 @@ A Javascript implementation of the [URL Living Standard](https://url.spec.whatwg
|
|
|
11
11
|
|
|
12
12
|
# Version
|
|
13
13
|
Current version implements the standard as of commit [7ae1c69](https://url.spec.whatwg.org/commit-snapshots/7ae1c691c96f0d82fafa24c33aa1e8df9ffbf2bc/).
|
|
14
|
+
|
|
15
|
+
# Installation
|
|
16
|
+
```
|
|
17
|
+
npm install @oozcitak/url
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
# Usage
|
|
21
|
+
Create an instance of the `URL` or `URLSearchParams` classes.
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
const { URL } = require("@oozcitak/url");
|
|
25
|
+
|
|
26
|
+
const url = new URL("https://example.org/file.aspx")
|
|
27
|
+
```
|
package/lib/URLAlgorithm.d.ts
CHANGED
|
@@ -1,321 +1,267 @@
|
|
|
1
|
-
import { URLRecord, ParserState, Host, Origin } from
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
*/
|
|
269
|
-
urlEquals(urlA: URLRecord, urlB: URLRecord, excludeFragmentsFlag?: boolean): boolean;
|
|
270
|
-
/**
|
|
271
|
-
* Parses an `application/x-www-form-urlencoded` string.
|
|
272
|
-
*
|
|
273
|
-
* @param input - a string
|
|
274
|
-
*/
|
|
275
|
-
urlEncodedStringParser(input: string): [string, string][];
|
|
276
|
-
/**
|
|
277
|
-
* Parses `application/x-www-form-urlencoded` bytes.
|
|
278
|
-
*
|
|
279
|
-
* @param input - a byte sequence
|
|
280
|
-
*/
|
|
281
|
-
urlEncodedParser(input: Uint8Array): [string, string][];
|
|
282
|
-
/**
|
|
283
|
-
* Serializes `application/x-www-form-urlencoded` bytes.
|
|
284
|
-
*
|
|
285
|
-
* @param input - a byte sequence
|
|
286
|
-
*/
|
|
287
|
-
urlEncodedByteSerializer(input: Uint8Array): string;
|
|
288
|
-
/**
|
|
289
|
-
* Serializes `application/x-www-form-urlencoded` tuples.
|
|
290
|
-
*
|
|
291
|
-
* @param input - input tuple of name/value pairs
|
|
292
|
-
* @param encodingOverride: encoding override
|
|
293
|
-
*/
|
|
294
|
-
urlEncodedSerializer(tuples: [string, string][], encodingOverride?: string): string;
|
|
295
|
-
/**
|
|
296
|
-
* Returns a URL's origin.
|
|
297
|
-
*
|
|
298
|
-
* @param url - a URL
|
|
299
|
-
*/
|
|
300
|
-
origin(url: URLRecord): Origin;
|
|
301
|
-
/**
|
|
302
|
-
* Converts a domain string to ASCII.
|
|
303
|
-
*
|
|
304
|
-
* @param domain - a domain string
|
|
305
|
-
*/
|
|
306
|
-
domainToASCII(domain: string, beStrict?: boolean): string | null;
|
|
307
|
-
/**
|
|
308
|
-
* Converts a domain string to Unicode.
|
|
309
|
-
*
|
|
310
|
-
* @param domain - a domain string
|
|
311
|
-
*/
|
|
312
|
-
domainToUnicode(domain: string, beStrict?: boolean): string;
|
|
313
|
-
/**
|
|
314
|
-
* Serializes an origin.
|
|
315
|
-
* This function is from the HTML spec:
|
|
316
|
-
* https://html.spec.whatwg.org/#ascii-serialisation-of-an-origin
|
|
317
|
-
*
|
|
318
|
-
* @param origin - an origin
|
|
319
|
-
*/
|
|
320
|
-
asciiSerializationOfAnOrigin(origin: Origin): string;
|
|
321
|
-
}
|
|
1
|
+
import { URLRecord, ParserState, Host, Origin } from "./interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* Sets the callback function for validation errors.
|
|
4
|
+
*
|
|
5
|
+
* @param validationErrorCallback - a callback function to be called when a
|
|
6
|
+
* validation error occurs
|
|
7
|
+
*/
|
|
8
|
+
export declare function setValidationErrorCallback(validationErrorCallback?: ((message: string) => void)): void;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new URL.
|
|
11
|
+
*/
|
|
12
|
+
export declare function newURL(): URLRecord;
|
|
13
|
+
/**
|
|
14
|
+
* Determines if the scheme is a special scheme.
|
|
15
|
+
*
|
|
16
|
+
* @param scheme - a scheme
|
|
17
|
+
*/
|
|
18
|
+
export declare function isSpecialScheme(scheme: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Determines if the URL has a special scheme.
|
|
21
|
+
*
|
|
22
|
+
* @param url - an URL
|
|
23
|
+
*/
|
|
24
|
+
export declare function isSpecial(url: URLRecord): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the default port for a special scheme.
|
|
27
|
+
*
|
|
28
|
+
* @param scheme - a scheme
|
|
29
|
+
*/
|
|
30
|
+
export declare function defaultPort(scheme: string): number | null;
|
|
31
|
+
/**
|
|
32
|
+
* Determines if the URL has credentials.
|
|
33
|
+
*
|
|
34
|
+
* @param url - an URL
|
|
35
|
+
*/
|
|
36
|
+
export declare function includesCredentials(url: URLRecord): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Determines if an URL cannot have credentials.
|
|
39
|
+
*
|
|
40
|
+
* @param url - an URL
|
|
41
|
+
*/
|
|
42
|
+
export declare function cannotHaveAUsernamePasswordPort(url: URLRecord): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Serializes an URL into a string.
|
|
45
|
+
*
|
|
46
|
+
* @param url - an URL
|
|
47
|
+
*/
|
|
48
|
+
export declare function urlSerializer(url: URLRecord, excludeFragmentFlag?: boolean): string;
|
|
49
|
+
/**
|
|
50
|
+
* Serializes a host into a string.
|
|
51
|
+
*
|
|
52
|
+
* @param host - a host
|
|
53
|
+
*/
|
|
54
|
+
export declare function hostSerializer(host: Host): string;
|
|
55
|
+
/**
|
|
56
|
+
* Serializes an IPv4 address into a string.
|
|
57
|
+
*
|
|
58
|
+
* @param address - an IPv4 address
|
|
59
|
+
*/
|
|
60
|
+
export declare function iPv4Serializer(address: number): string;
|
|
61
|
+
/**
|
|
62
|
+
* Serializes an IPv6 address into a string.
|
|
63
|
+
*
|
|
64
|
+
* @param address - an IPv6 address represented as a list of eight numbers
|
|
65
|
+
*/
|
|
66
|
+
export declare function iPv6Serializer(address: number[]): string;
|
|
67
|
+
/**
|
|
68
|
+
* Parses an URL string.
|
|
69
|
+
*
|
|
70
|
+
* @param input - input string
|
|
71
|
+
* @param baseURL - base URL
|
|
72
|
+
* @param encodingOverride - encoding override
|
|
73
|
+
*/
|
|
74
|
+
export declare function urlParser(input: string, baseURL?: URLRecord, encodingOverride?: string): URLRecord | null;
|
|
75
|
+
/**
|
|
76
|
+
* Parses an URL string.
|
|
77
|
+
*
|
|
78
|
+
* @param input - input string
|
|
79
|
+
* @param baseURL - base URL
|
|
80
|
+
* @param encodingOverride - encoding override
|
|
81
|
+
*/
|
|
82
|
+
export declare function basicURLParser(input: string, baseURL?: URLRecord | null, encodingOverride?: string, url?: URLRecord, stateOverride?: ParserState): URLRecord | null;
|
|
83
|
+
/**
|
|
84
|
+
* Sets a URL's username.
|
|
85
|
+
*
|
|
86
|
+
* @param url - a URL
|
|
87
|
+
* @param username - username string
|
|
88
|
+
*/
|
|
89
|
+
export declare function setTheUsername(url: URLRecord, username: string): void;
|
|
90
|
+
/**
|
|
91
|
+
* Sets a URL's password.
|
|
92
|
+
*
|
|
93
|
+
* @param url - a URL
|
|
94
|
+
* @param username - password string
|
|
95
|
+
*/
|
|
96
|
+
export declare function setThePassword(url: URLRecord, password: string): void;
|
|
97
|
+
/**
|
|
98
|
+
* Determines if the string represents a single dot path.
|
|
99
|
+
*
|
|
100
|
+
* @param str - a string
|
|
101
|
+
*/
|
|
102
|
+
export declare function isSingleDotPathSegment(str: string): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Determines if the string represents a double dot path.
|
|
105
|
+
*
|
|
106
|
+
* @param str - a string
|
|
107
|
+
*/
|
|
108
|
+
export declare function isDoubleDotPathSegment(str: string): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Shorten's URL's path.
|
|
111
|
+
*
|
|
112
|
+
* @param url - an URL
|
|
113
|
+
*/
|
|
114
|
+
export declare function shorten(url: URLRecord): void;
|
|
115
|
+
/**
|
|
116
|
+
* Determines if a string is a normalized Windows drive letter.
|
|
117
|
+
*
|
|
118
|
+
* @param str - a string
|
|
119
|
+
*/
|
|
120
|
+
export declare function isNormalizedWindowsDriveLetter(str: string): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Determines if a string is a Windows drive letter.
|
|
123
|
+
*
|
|
124
|
+
* @param str - a string
|
|
125
|
+
*/
|
|
126
|
+
export declare function isWindowsDriveLetter(str: string): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Determines if a string starts with a Windows drive letter.
|
|
129
|
+
*
|
|
130
|
+
* @param str - a string
|
|
131
|
+
*/
|
|
132
|
+
export declare function startsWithAWindowsDriveLetter(str: string): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Parses a host string.
|
|
135
|
+
*
|
|
136
|
+
* @param input - input string
|
|
137
|
+
* @param isNotSpecial - `true` if the source URL is not special; otherwise
|
|
138
|
+
* `false`.
|
|
139
|
+
*/
|
|
140
|
+
export declare function hostParser(input: string, isNotSpecial?: boolean): string | number | number[] | null;
|
|
141
|
+
/**
|
|
142
|
+
* Parses a string containing an IP v4 address.
|
|
143
|
+
*
|
|
144
|
+
* @param input - input string
|
|
145
|
+
* @param isNotSpecial - `true` if the source URL is not special; otherwise
|
|
146
|
+
* `false`.
|
|
147
|
+
*/
|
|
148
|
+
export declare function iPv4NumberParser(input: string, validationErrorFlag?: {
|
|
149
|
+
value: boolean;
|
|
150
|
+
}): number | null;
|
|
151
|
+
/**
|
|
152
|
+
* Parses a string containing an IP v4 address.
|
|
153
|
+
*
|
|
154
|
+
* @param input - input string
|
|
155
|
+
*/
|
|
156
|
+
export declare function iPv4Parser(input: string): string | number | null;
|
|
157
|
+
/**
|
|
158
|
+
* Parses a string containing an IP v6 address.
|
|
159
|
+
*
|
|
160
|
+
* @param input - input string
|
|
161
|
+
*/
|
|
162
|
+
export declare function iPv6Parser(input: string): number[] | null;
|
|
163
|
+
/**
|
|
164
|
+
* Parses an opaque host string.
|
|
165
|
+
*
|
|
166
|
+
* @param input - a string
|
|
167
|
+
*/
|
|
168
|
+
export declare function opaqueHostParser(input: string): string | null;
|
|
169
|
+
/**
|
|
170
|
+
* Resolves a Blob URL from the user agent's Blob URL store.
|
|
171
|
+
* function is not implemented.
|
|
172
|
+
* See: https://w3c.github.io/FileAPI/#blob-url-resolve
|
|
173
|
+
*
|
|
174
|
+
* @param url - an url
|
|
175
|
+
*/
|
|
176
|
+
export declare function resolveABlobURL(url: URLRecord): any;
|
|
177
|
+
/**
|
|
178
|
+
* Percent encodes a byte.
|
|
179
|
+
*
|
|
180
|
+
* @param value - a byte
|
|
181
|
+
*/
|
|
182
|
+
export declare function percentEncode(value: number): string;
|
|
183
|
+
/**
|
|
184
|
+
* Percent decodes a byte sequence input.
|
|
185
|
+
*
|
|
186
|
+
* @param input - a byte sequence
|
|
187
|
+
*/
|
|
188
|
+
export declare function percentDecode(input: Uint8Array): Uint8Array;
|
|
189
|
+
/**
|
|
190
|
+
* String percent decodes a string.
|
|
191
|
+
*
|
|
192
|
+
* @param input - a string
|
|
193
|
+
*/
|
|
194
|
+
export declare function stringPercentDecode(input: string): Uint8Array;
|
|
195
|
+
/**
|
|
196
|
+
* UTF-8 percent encodes a code point, using a percent encode set.
|
|
197
|
+
*
|
|
198
|
+
* @param codePoint - a code point
|
|
199
|
+
* @param percentEncodeSet - a percent encode set
|
|
200
|
+
*/
|
|
201
|
+
export declare function utf8PercentEncode(codePoint: string, percentEncodeSet: RegExp): string;
|
|
202
|
+
/**
|
|
203
|
+
* Determines if two hosts are considered equal.
|
|
204
|
+
*
|
|
205
|
+
* @param hostA - a host
|
|
206
|
+
* @param hostB - a host
|
|
207
|
+
*/
|
|
208
|
+
export declare function hostEquals(hostA: Host, hostB: Host): boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Determines if two URLs are considered equal.
|
|
211
|
+
*
|
|
212
|
+
* @param urlA - a URL
|
|
213
|
+
* @param urlB - a URL
|
|
214
|
+
* @param excludeFragmentsFlag - whether to ignore fragments while comparing
|
|
215
|
+
*/
|
|
216
|
+
export declare function urlEquals(urlA: URLRecord, urlB: URLRecord, excludeFragmentsFlag?: boolean): boolean;
|
|
217
|
+
/**
|
|
218
|
+
* Parses an `application/x-www-form-urlencoded` string.
|
|
219
|
+
*
|
|
220
|
+
* @param input - a string
|
|
221
|
+
*/
|
|
222
|
+
export declare function urlEncodedStringParser(input: string): [string, string][];
|
|
223
|
+
/**
|
|
224
|
+
* Parses `application/x-www-form-urlencoded` bytes.
|
|
225
|
+
*
|
|
226
|
+
* @param input - a byte sequence
|
|
227
|
+
*/
|
|
228
|
+
export declare function urlEncodedParser(input: Uint8Array): [string, string][];
|
|
229
|
+
/**
|
|
230
|
+
* Serializes `application/x-www-form-urlencoded` bytes.
|
|
231
|
+
*
|
|
232
|
+
* @param input - a byte sequence
|
|
233
|
+
*/
|
|
234
|
+
export declare function urlEncodedByteSerializer(input: Uint8Array): string;
|
|
235
|
+
/**
|
|
236
|
+
* Serializes `application/x-www-form-urlencoded` tuples.
|
|
237
|
+
*
|
|
238
|
+
* @param input - input tuple of name/value pairs
|
|
239
|
+
* @param encodingOverride: encoding override
|
|
240
|
+
*/
|
|
241
|
+
export declare function urlEncodedSerializer(tuples: [string, string][], encodingOverride?: string): string;
|
|
242
|
+
/**
|
|
243
|
+
* Returns a URL's origin.
|
|
244
|
+
*
|
|
245
|
+
* @param url - a URL
|
|
246
|
+
*/
|
|
247
|
+
export declare function origin(url: URLRecord): Origin;
|
|
248
|
+
/**
|
|
249
|
+
* Converts a domain string to ASCII.
|
|
250
|
+
*
|
|
251
|
+
* @param domain - a domain string
|
|
252
|
+
*/
|
|
253
|
+
export declare function domainToASCII(domain: string, beStrict?: boolean): string | null;
|
|
254
|
+
/**
|
|
255
|
+
* Converts a domain string to Unicode.
|
|
256
|
+
*
|
|
257
|
+
* @param domain - a domain string
|
|
258
|
+
*/
|
|
259
|
+
export declare function domainToUnicode(domain: string, beStrict?: boolean): string;
|
|
260
|
+
/**
|
|
261
|
+
* Serializes an origin.
|
|
262
|
+
* function is from the HTML spec:
|
|
263
|
+
* https://html.spec.whatwg.org/#ascii-serialisation-of-an-origin
|
|
264
|
+
*
|
|
265
|
+
* @param origin - an origin
|
|
266
|
+
*/
|
|
267
|
+
export declare function asciiSerializationOfAnOrigin(origin: Origin): string;
|