@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.
Files changed (47) hide show
  1. package/README.md +14 -0
  2. package/lib/URLAlgorithm.d.ts +267 -321
  3. package/lib/URLAlgorithm.js +2217 -2184
  4. package/lib/URLAlgorithm.js.map +1 -1
  5. package/lib/URLImpl.d.ts +22 -14
  6. package/lib/URLImpl.js +24 -25
  7. package/lib/URLImpl.js.map +1 -1
  8. package/lib/URLSearchParamsImpl.d.ts +0 -2
  9. package/lib/URLSearchParamsImpl.js +4 -5
  10. package/lib/URLSearchParamsImpl.js.map +1 -1
  11. package/lib/index.d.ts +2 -4
  12. package/lib/index.js +4 -15
  13. package/lib/index.js.map +1 -1
  14. package/package.json +5 -5
  15. package/lib/IDNAMappingTable.d.ts +0 -41
  16. package/lib/IDNAMappingTable.js +0 -8688
  17. package/lib/IDNAMappingTable.js.map +0 -1
  18. package/lib/TreeMap.d.ts +0 -39
  19. package/lib/TreeMap.js +0 -105
  20. package/lib/TreeMap.js.map +0 -1
  21. package/lib/algorithm/URLAlgorithm.d.ts +0 -321
  22. package/lib/algorithm/URLAlgorithm.js +0 -2552
  23. package/lib/algorithm/URLAlgorithm.js.map +0 -1
  24. package/lib/algorithm/index.d.ts +0 -1
  25. package/lib/algorithm/index.js +0 -5
  26. package/lib/algorithm/index.js.map +0 -1
  27. package/lib/interfacesInternal.d.ts +0 -22
  28. package/lib/interfacesInternal.js +0 -3
  29. package/lib/interfacesInternal.js.map +0 -1
  30. package/lib/url/URLImpl.d.ts +0 -45
  31. package/lib/url/URLImpl.js +0 -329
  32. package/lib/url/URLImpl.js.map +0 -1
  33. package/lib/url/URLSearchParamsImpl.d.ts +0 -40
  34. package/lib/url/URLSearchParamsImpl.js +0 -184
  35. package/lib/url/URLSearchParamsImpl.js.map +0 -1
  36. package/lib/url/index.d.ts +0 -4
  37. package/lib/url/index.js +0 -16
  38. package/lib/url/index.js.map +0 -1
  39. package/lib/url/interfaces.d.ts +0 -195
  40. package/lib/url/interfaces.js +0 -31
  41. package/lib/url/interfaces.js.map +0 -1
  42. package/lib/util/StringWalker.d.ts +0 -48
  43. package/lib/util/StringWalker.js +0 -92
  44. package/lib/util/StringWalker.js.map +0 -1
  45. package/lib/util/index.d.ts +0 -59
  46. package/lib/util/index.js +0 -170
  47. package/lib/util/index.js.map +0 -1
package/lib/TreeMap.d.ts DELETED
@@ -1,39 +0,0 @@
1
- /**
2
- * Represents a tree-map.
3
- */
4
- export declare class TreeMap<T> {
5
- protected _root: MapNode<T>;
6
- /**
7
- * Initializes a new `TreeMap`.
8
- *
9
- * @param min - minimum value
10
- * @param max - maximum value
11
- * @param value - default value
12
- */
13
- constructor(min: number, max: number, value: T);
14
- /**
15
- * Adds a new range of values.
16
- *
17
- * @param min - minimum value
18
- * @param max - maximum value
19
- * @param value - value
20
- */
21
- add(min: number, max: number, value: T): void;
22
- /**
23
- * Gets a value.
24
- *
25
- * @param key - a key
26
- */
27
- get(key: number): T;
28
- }
29
- declare class MapNode<T> {
30
- protected _min: number;
31
- protected _max: number;
32
- protected _value: T;
33
- protected _left: MapNode<T> | undefined;
34
- protected _right: MapNode<T> | undefined;
35
- constructor(min: number, max: number, value: T);
36
- divideNode(min: number, max: number, value: T): void;
37
- getNodeValue(key: number): T;
38
- }
39
- export {};
package/lib/TreeMap.js DELETED
@@ -1,105 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * Represents a tree-map.
5
- */
6
- class TreeMap {
7
- /**
8
- * Initializes a new `TreeMap`.
9
- *
10
- * @param min - minimum value
11
- * @param max - maximum value
12
- * @param value - default value
13
- */
14
- constructor(min, max, value) {
15
- this._root = new MapNode(min, max, value);
16
- }
17
- /**
18
- * Adds a new range of values.
19
- *
20
- * @param min - minimum value
21
- * @param max - maximum value
22
- * @param value - value
23
- */
24
- add(min, max, value) {
25
- this._root.divideNode(min, max, value);
26
- }
27
- /**
28
- * Gets a value.
29
- *
30
- * @param key - a key
31
- */
32
- get(key) {
33
- return this._root.getNodeValue(key);
34
- }
35
- }
36
- exports.TreeMap = TreeMap;
37
- class MapNode {
38
- constructor(min, max, value) {
39
- this._left = undefined;
40
- this._right = undefined;
41
- this._min = min;
42
- this._max = max;
43
- this._value = value;
44
- }
45
- divideNode(min, max, value) {
46
- if (min < this._min || max > this._max) {
47
- throw new Error("Map keys outside node limits.");
48
- }
49
- if (this._left === undefined && this._right === undefined) {
50
- if (min === this._min && max === this._max) {
51
- this._value = value;
52
- }
53
- else if (min === this._min) {
54
- this._left = new MapNode(min, max, value);
55
- this._right = new MapNode(max + 1, this._max, this._value);
56
- }
57
- else if (max === this._max) {
58
- this._left = new MapNode(this._min, min - 1, this._value);
59
- this._right = new MapNode(min, max, value);
60
- }
61
- else if ((min + max) / 2 < (this._min + this._max) / 2) {
62
- this._left = new MapNode(this._min, max, this._value);
63
- this._right = new MapNode(max + 1, this._max, this._value);
64
- this._left.divideNode(min, max, value);
65
- }
66
- else {
67
- this._left = new MapNode(this._min, min - 1, this._value);
68
- this._right = new MapNode(min, this._max, this._value);
69
- this._right.divideNode(min, max, value);
70
- }
71
- }
72
- else if (this._left === undefined || this._right === undefined) {
73
- throw new Error("Invalid maps state.");
74
- }
75
- else {
76
- if (min >= this._left._min && max <= this._left._max)
77
- this._left.divideNode(min, max, value);
78
- else if (min >= this._right._min && max <= this._right._max)
79
- this._right.divideNode(min, max, value);
80
- else
81
- throw new Error("Map keys overlaps with existing keys.");
82
- }
83
- }
84
- getNodeValue(key) {
85
- if (key < this._min || key > this._max) {
86
- throw new Error("Map key outside node limits.");
87
- }
88
- if (this._left === undefined && this._right === undefined) {
89
- return this._value;
90
- }
91
- else if (this._left === undefined || this._right === undefined) {
92
- throw new Error("Invalid maps state.");
93
- }
94
- else if (key >= this._left._min && key <= this._left._max) {
95
- return this._left._value;
96
- }
97
- else if (key >= this._right._min && key <= this._right._max) {
98
- return this._right._value;
99
- }
100
- else {
101
- throw new Error("Map keys overlaps with existing keys.");
102
- }
103
- }
104
- }
105
- //# sourceMappingURL=TreeMap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TreeMap.js","sourceRoot":"","sources":["../src/TreeMap.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,MAAa,OAAO;IAGlB;;;;;;OAMG;IACH,YAAY,GAAW,EAAE,GAAW,EAAE,KAAQ;QAC5C,IAAI,CAAC,KAAK,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;IAC3C,CAAC;IAED;;;;;;OAMG;IACH,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,KAAQ;QACpC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;IACxC,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IACrC,CAAC;CAEF;AAlCD,0BAkCC;AAED,MAAM,OAAO;IAOX,YAAY,GAAW,EAAE,GAAW,EAAE,KAAQ;QAHpC,UAAK,GAA2B,SAAS,CAAA;QACzC,WAAM,GAA2B,SAAS,CAAA;QAGlD,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;QACf,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;QACf,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,CAAC;IAED,UAAU,CAAC,GAAW,EAAE,GAAW,EAAE,KAAQ;QAC3C,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE;YACtC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;SACjD;QAED,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE;YACzD,IAAI,GAAG,KAAK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AAI,KAAK,CAAC,qBAAqB,CAAC,CAAA;SACvC;aAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YAC3D,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAA;SACzB;aAAM,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;YAC7D,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAA;SAC1B;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAA;SACzD;IACH,CAAC;CACF"}
@@ -1,321 +0,0 @@
1
- import { URLRecord, ParserState, Host, Origin } from '../url/interfaces';
2
- /**
3
- * Represents algorithms to manipulate URLs.
4
- */
5
- export declare class URLAlgorithm {
6
- protected _validationErrorCallback: ((message: string) => void) | undefined;
7
- /**
8
- * Default ports for a special URL scheme.
9
- */
10
- protected _defaultPorts: {
11
- [key: string]: number | null;
12
- };
13
- /**
14
- * The C0 control percent-encode set are the C0 controls and all code points
15
- * greater than U+007E (~).
16
- */
17
- protected _c0ControlPercentEncodeSet: RegExp;
18
- /**
19
- * The fragment percent-encode set is the C0 control percent-encode set and
20
- * U+0020 SPACE, U+0022 ("), U+003C (<), U+003E (>), and U+0060 (`).
21
- */
22
- protected _fragmentPercentEncodeSet: RegExp;
23
- /**
24
- * The path percent-encode set is the fragment percent-encode set and
25
- * U+0023 (#), U+003F (?), U+007B ({), and U+007D (}).
26
- */
27
- protected _pathPercentEncodeSet: RegExp;
28
- /**
29
- * The userinfo percent-encode set is the path percent-encode set and
30
- * U+002F (/), U+003A (:), U+003B (;), U+003D (=), U+0040 (@), U+005B ([),
31
- * U+005C (\), U+005D (]), U+005E (^), and U+007C (|).
32
- */
33
- protected _userInfoPercentEncodeSet: RegExp;
34
- /**
35
- * The URL code points are ASCII alphanumeric, U+0021 (!), U+0024 ($),
36
- * U+0026 (&), U+0027 ('), U+0028 LEFT PARENTHESIS, U+0029 RIGHT PARENTHESIS,
37
- * U+002A (*), U+002B (+), U+002C (,), U+002D (-), U+002E (.), U+002F (/),
38
- * U+003A (:), U+003B (;), U+003D (=), U+003F (?), U+0040 (@), U+005F (_),
39
- * U+007E (~), and code points in the range U+00A0 to U+10FFFD, inclusive,
40
- * excluding surrogates and noncharacters.
41
- */
42
- protected _urlCodePoints: RegExp;
43
- /**
44
- * A forbidden host code point is U+0000 NULL, U+0009 TAB, U+000A LF,
45
- * U+000D CR, U+0020 SPACE, U+0023 (#), U+0025 (%), U+002F (/), U+003A (:),
46
- * U+003F (?), U+0040 (@), U+005B ([), U+005C (\), or U+005D (]).
47
- */
48
- protected _forbiddenHostCodePoint: RegExp;
49
- /**
50
- * Initializes a new `URLAlgorithm`.
51
- *
52
- * @param validationErrorCallback - a callback function to be called when a
53
- * validation error occurs
54
- */
55
- constructor(validationErrorCallback?: ((message: string) => void));
56
- /**
57
- * Generates a validation error.
58
- *
59
- * @param message - error message
60
- */
61
- validationError(message: string): void;
62
- /**
63
- * Creates a new URL.
64
- */
65
- newURL(): URLRecord;
66
- /**
67
- * Determines if the scheme is a special scheme.
68
- *
69
- * @param scheme - a scheme
70
- */
71
- isSpecialScheme(scheme: string): boolean;
72
- /**
73
- * Determines if the URL has a special scheme.
74
- *
75
- * @param url - an URL
76
- */
77
- isSpecial(url: URLRecord): boolean;
78
- /**
79
- * Returns the default port for a special scheme.
80
- *
81
- * @param scheme - a scheme
82
- */
83
- defaultPort(scheme: string): number | null;
84
- /**
85
- * Determines if the URL has credentials.
86
- *
87
- * @param url - an URL
88
- */
89
- includesCredentials(url: URLRecord): boolean;
90
- /**
91
- * Determines if an URL cannot have credentials.
92
- *
93
- * @param url - an URL
94
- */
95
- cannotHaveAUsernamePasswordPort(url: URLRecord): boolean;
96
- /**
97
- * Serializes an URL into a string.
98
- *
99
- * @param url - an URL
100
- */
101
- urlSerializer(url: URLRecord, excludeFragmentFlag?: boolean): string;
102
- /**
103
- * Serializes a host into a string.
104
- *
105
- * @param host - a host
106
- */
107
- hostSerializer(host: Host): string;
108
- /**
109
- * Serializes an IPv4 address into a string.
110
- *
111
- * @param address - an IPv4 address
112
- */
113
- iPv4Serializer(address: number): string;
114
- /**
115
- * Serializes an IPv6 address into a string.
116
- *
117
- * @param address - an IPv6 address represented as a list of eight numbers
118
- */
119
- iPv6Serializer(address: number[]): string;
120
- /**
121
- * Parses an URL string.
122
- *
123
- * @param input - input string
124
- * @param baseURL - base URL
125
- * @param encodingOverride - encoding override
126
- */
127
- urlParser(input: string, baseURL?: URLRecord, encodingOverride?: string): URLRecord | null;
128
- /**
129
- * Parses an URL string.
130
- *
131
- * @param input - input string
132
- * @param baseURL - base URL
133
- * @param encodingOverride - encoding override
134
- */
135
- basicURLParser(input: string, baseURL?: URLRecord | null, encodingOverride?: string, url?: URLRecord, stateOverride?: ParserState): URLRecord | null;
136
- /**
137
- * Sets a URL's username.
138
- *
139
- * @param url - a URL
140
- * @param username - username string
141
- */
142
- setTheUsername(url: URLRecord, username: string): void;
143
- /**
144
- * Sets a URL's password.
145
- *
146
- * @param url - a URL
147
- * @param username - password string
148
- */
149
- setThePassword(url: URLRecord, password: string): void;
150
- /**
151
- * Determines if the string represents a single dot path.
152
- *
153
- * @param str - a string
154
- */
155
- isSingleDotPathSegment(str: string): boolean;
156
- /**
157
- * Determines if the string represents a double dot path.
158
- *
159
- * @param str - a string
160
- */
161
- isDoubleDotPathSegment(str: string): boolean;
162
- /**
163
- * Shorten's URL's path.
164
- *
165
- * @param url - an URL
166
- */
167
- shorten(url: URLRecord): void;
168
- /**
169
- * Determines if a string is a normalized Windows drive letter.
170
- *
171
- * @param str - a string
172
- */
173
- isNormalizedWindowsDriveLetter(str: string): boolean;
174
- /**
175
- * Determines if a string is a Windows drive letter.
176
- *
177
- * @param str - a string
178
- */
179
- isWindowsDriveLetter(str: string): boolean;
180
- /**
181
- * Determines if a string starts with a Windows drive letter.
182
- *
183
- * @param str - a string
184
- */
185
- startsWithAWindowsDriveLetter(str: string): boolean;
186
- /**
187
- * Parses a host string.
188
- *
189
- * @param input - input string
190
- * @param isNotSpecial - `true` if the source URL is not special; otherwise
191
- * `false`.
192
- */
193
- hostParser(input: string, isNotSpecial?: boolean): string | number | number[] | null;
194
- /**
195
- * Parses a string containing an IP v4 address.
196
- *
197
- * @param input - input string
198
- * @param isNotSpecial - `true` if the source URL is not special; otherwise
199
- * `false`.
200
- */
201
- iPv4NumberParser(input: string, validationErrorFlag?: {
202
- value: boolean;
203
- }): number | null;
204
- /**
205
- * Parses a string containing an IP v4 address.
206
- *
207
- * @param input - input string
208
- */
209
- iPv4Parser(input: string): string | number | null;
210
- /**
211
- * Parses a string containing an IP v6 address.
212
- *
213
- * @param input - input string
214
- */
215
- iPv6Parser(input: string): number[] | null;
216
- /**
217
- * Parses an opaque host string.
218
- *
219
- * @param input - a string
220
- */
221
- opaqueHostParser(input: string): string | null;
222
- /**
223
- * Resolves a Blob URL from the user agent's Blob URL store.
224
- * This function is not implemented.
225
- * See: https://w3c.github.io/FileAPI/#blob-url-resolve
226
- *
227
- * @param url - an url
228
- */
229
- resolveABlobURL(url: URLRecord): any;
230
- /**
231
- * Percent encodes a byte.
232
- *
233
- * @param value - a byte
234
- */
235
- percentEncode(value: number): string;
236
- /**
237
- * Percent decodes a byte sequence input.
238
- *
239
- * @param input - a byte sequence
240
- */
241
- percentDecode(input: Uint8Array): Uint8Array;
242
- /**
243
- * String percent decodes a string.
244
- *
245
- * @param input - a string
246
- */
247
- stringPercentDecode(input: string): Uint8Array;
248
- /**
249
- * UTF-8 percent encodes a code point, using a percent encode set.
250
- *
251
- * @param codePoint - a code point
252
- * @param percentEncodeSet - a percent encode set
253
- */
254
- utf8PercentEncode(codePoint: string, percentEncodeSet: RegExp): string;
255
- /**
256
- * Determines if two hosts are considered equal.
257
- *
258
- * @param hostA - a host
259
- * @param hostB - a host
260
- */
261
- hostEquals(hostA: Host, hostB: Host): boolean;
262
- /**
263
- * Determines if two URLs are considered equal.
264
- *
265
- * @param urlA - a URL
266
- * @param urlB - a URL
267
- * @param excludeFragmentsFlag - whether to ignore fragments while comparing
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
- }