@oozcitak/url 0.0.10 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/URLImpl.js CHANGED
@@ -1,30 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const URLSearchParamsImpl_1 = require("./URLSearchParamsImpl");
4
- const interfaces_1 = require("./interfaces");
5
- const URLAlgorithm_1 = require("./URLAlgorithm");
3
+ var URLSearchParamsImpl_1 = require("./URLSearchParamsImpl");
4
+ var interfaces_1 = require("./interfaces");
5
+ var URLAlgorithm_1 = require("./URLAlgorithm");
6
6
  /**
7
7
  * Represents an URL.
8
8
  */
9
- class URLImpl {
9
+ var URLImpl = /** @class */ (function () {
10
10
  /**
11
11
  * Initializes a new `URL`.
12
12
  *
13
13
  * @param url - an URL string
14
14
  * @param base - a base URL string
15
15
  */
16
- constructor(url, baseURL) {
16
+ function URLImpl(url, baseURL) {
17
17
  /**
18
18
  * 1. Let parsedBase be null.
19
19
  * 2. If base is given, then:
20
20
  * 2.1. Let parsedBase be the result of running the basic URL parser on base.
21
21
  * 2.2. If parsedBase is failure, then throw a TypeError.
22
22
  */
23
- let parsedBase = null;
23
+ var parsedBase = null;
24
24
  if (baseURL !== undefined) {
25
25
  parsedBase = URLAlgorithm_1.basicURLParser(baseURL);
26
26
  if (parsedBase === null) {
27
- throw new TypeError(`Invalid base URL: '${baseURL}'.`);
27
+ throw new TypeError("Invalid base URL: '" + baseURL + "'.");
28
28
  }
29
29
  }
30
30
  /**
@@ -32,9 +32,9 @@ class URLImpl {
32
32
  * with parsedBase.
33
33
  * 4. If parsedURL is failure, then throw a TypeError.
34
34
  */
35
- const parsedURL = URLAlgorithm_1.basicURLParser(url, parsedBase);
35
+ var parsedURL = URLAlgorithm_1.basicURLParser(url, parsedBase);
36
36
  if (parsedURL === null) {
37
- throw new TypeError(`Invalid URL: '${url}'.`);
37
+ throw new TypeError("Invalid URL: '" + url + "'.");
38
38
  }
39
39
  /**
40
40
  * 5. Let query be parsedURL’s query, if that is non-null, and the empty
@@ -45,284 +45,333 @@ class URLImpl {
45
45
  * and then set that query object’s url object to result.
46
46
  * 9. Return result.
47
47
  */
48
- const query = parsedURL.query || "";
48
+ var query = parsedURL.query || "";
49
49
  this._url = parsedURL;
50
50
  this._queryObject = new URLSearchParamsImpl_1.URLSearchParamsImpl(query);
51
51
  this._queryObject._urlObject = this;
52
52
  }
53
- /** @inheritdoc */
54
- get href() {
55
- /**
56
- * The href attribute’s getter and the toJSON() method, when invoked, must
57
- * return the serialization of context object’s url.
58
- */
59
- return URLAlgorithm_1.urlSerializer(this._url);
60
- }
61
- set href(value) {
62
- /**
63
- * 1. Let parsedURL be the result of running the basic URL parser on the
64
- * given value.
65
- * 2. If parsedURL is failure, then throw a TypeError.
66
- */
67
- const parsedURL = URLAlgorithm_1.basicURLParser(value);
68
- if (parsedURL === null) {
69
- throw new TypeError(`Invalid URL: '${value}'.`);
70
- }
71
- /**
72
- * 3. Set context object’s url to parsedURL.
73
- * 4. Empty context object’s query object’s list.
74
- * 5. Let query be context object’s url’s query.
75
- * 6. If query is non-null, then set context object’s query object’s list to
76
- * the result of parsing query.
77
- */
78
- this._url = parsedURL;
79
- this._queryObject._list = [];
80
- const query = this._url.query;
81
- if (query !== null) {
82
- this._queryObject._list = URLAlgorithm_1.urlEncodedStringParser(query);
83
- }
84
- }
85
- /** @inheritdoc */
86
- get origin() {
87
- /**
88
- * The origin attribute’s getter must return the serialization of context
89
- * object’s url’s origin. [HTML]
90
- */
91
- return URLAlgorithm_1.asciiSerializationOfAnOrigin(URLAlgorithm_1.origin(this._url));
92
- }
93
- /** @inheritdoc */
94
- get protocol() {
95
- /**
96
- * The protocol attribute’s getter must return context object url’s scheme,
97
- * followed by U+003A (:).
98
- */
99
- return this._url.scheme + ':';
100
- }
101
- set protocol(val) {
102
- /**
103
- * The protocol attribute’s setter must basic URL parse the given value,
104
- * followed by U+003A (:), with context object’s url as url and scheme start
105
- * state as state override.
106
- */
107
- URLAlgorithm_1.basicURLParser(val + ':', undefined, undefined, this._url, interfaces_1.ParserState.SchemeStart);
108
- }
109
- /** @inheritdoc */
110
- get username() {
111
- /**
112
- * The username attribute’s getter must return context object’s url’s
113
- * username.
114
- */
115
- return this._url.username;
116
- }
117
- set username(val) {
118
- /**
119
- * 1. If context object’s url cannot have a username/password/port, then
120
- * return.
121
- * 2. Set the username given context object’s url and the given value.
122
- */
123
- if (URLAlgorithm_1.cannotHaveAUsernamePasswordPort(this._url))
124
- return;
125
- URLAlgorithm_1.setTheUsername(this._url, val);
126
- }
127
- /** @inheritdoc */
128
- get password() {
129
- /**
130
- * The password attribute’s getter must return context object’s url’s
131
- * password.
132
- */
133
- return this._url.password;
134
- }
135
- set password(val) {
136
- /**
137
- * 1. If context object’s url cannot have a username/password/port, then
138
- * return.
139
- * 2. Set the password given context object’s url and the given value.
140
- */
141
- if (URLAlgorithm_1.cannotHaveAUsernamePasswordPort(this._url))
142
- return;
143
- URLAlgorithm_1.setThePassword(this._url, val);
144
- }
145
- /** @inheritdoc */
146
- get host() {
147
- /**
148
- * 1. Let url be context object’s url.
149
- * 2. If url’s host is null, return the empty string.
150
- * 3. If url’s port is null, return url’s host, serialized.
151
- * 4. Return url’s host, serialized, followed by U+003A (:) and url’s port,
152
- * serialized.
153
- */
154
- if (this._url.host === null) {
155
- return "";
156
- }
157
- else if (this._url.port === null) {
53
+ Object.defineProperty(URLImpl.prototype, "href", {
54
+ /** @inheritdoc */
55
+ get: function () {
56
+ /**
57
+ * The href attribute’s getter and the toJSON() method, when invoked, must
58
+ * return the serialization of context object’s url.
59
+ */
60
+ return URLAlgorithm_1.urlSerializer(this._url);
61
+ },
62
+ set: function (value) {
63
+ /**
64
+ * 1. Let parsedURL be the result of running the basic URL parser on the
65
+ * given value.
66
+ * 2. If parsedURL is failure, then throw a TypeError.
67
+ */
68
+ var parsedURL = URLAlgorithm_1.basicURLParser(value);
69
+ if (parsedURL === null) {
70
+ throw new TypeError("Invalid URL: '" + value + "'.");
71
+ }
72
+ /**
73
+ * 3. Set context object’s url to parsedURL.
74
+ * 4. Empty context object’s query object’s list.
75
+ * 5. Let query be context object’s url’s query.
76
+ * 6. If query is non-null, then set context object’s query object’s list to
77
+ * the result of parsing query.
78
+ */
79
+ this._url = parsedURL;
80
+ this._queryObject._list = [];
81
+ var query = this._url.query;
82
+ if (query !== null) {
83
+ this._queryObject._list = URLAlgorithm_1.urlEncodedStringParser(query);
84
+ }
85
+ },
86
+ enumerable: true,
87
+ configurable: true
88
+ });
89
+ Object.defineProperty(URLImpl.prototype, "origin", {
90
+ /** @inheritdoc */
91
+ get: function () {
92
+ /**
93
+ * The origin attribute’s getter must return the serialization of context
94
+ * object’s url’s origin. [HTML]
95
+ */
96
+ return URLAlgorithm_1.asciiSerializationOfAnOrigin(URLAlgorithm_1.origin(this._url));
97
+ },
98
+ enumerable: true,
99
+ configurable: true
100
+ });
101
+ Object.defineProperty(URLImpl.prototype, "protocol", {
102
+ /** @inheritdoc */
103
+ get: function () {
104
+ /**
105
+ * The protocol attribute’s getter must return context object url’s scheme,
106
+ * followed by U+003A (:).
107
+ */
108
+ return this._url.scheme + ':';
109
+ },
110
+ set: function (val) {
111
+ /**
112
+ * The protocol attribute’s setter must basic URL parse the given value,
113
+ * followed by U+003A (:), with context object’s url as url and scheme start
114
+ * state as state override.
115
+ */
116
+ URLAlgorithm_1.basicURLParser(val + ':', undefined, undefined, this._url, interfaces_1.ParserState.SchemeStart);
117
+ },
118
+ enumerable: true,
119
+ configurable: true
120
+ });
121
+ Object.defineProperty(URLImpl.prototype, "username", {
122
+ /** @inheritdoc */
123
+ get: function () {
124
+ /**
125
+ * The username attribute’s getter must return context object’s url’s
126
+ * username.
127
+ */
128
+ return this._url.username;
129
+ },
130
+ set: function (val) {
131
+ /**
132
+ * 1. If context object’s url cannot have a username/password/port, then
133
+ * return.
134
+ * 2. Set the username given context object’s url and the given value.
135
+ */
136
+ if (URLAlgorithm_1.cannotHaveAUsernamePasswordPort(this._url))
137
+ return;
138
+ URLAlgorithm_1.setTheUsername(this._url, val);
139
+ },
140
+ enumerable: true,
141
+ configurable: true
142
+ });
143
+ Object.defineProperty(URLImpl.prototype, "password", {
144
+ /** @inheritdoc */
145
+ get: function () {
146
+ /**
147
+ * The password attribute’s getter must return context object’s url’s
148
+ * password.
149
+ */
150
+ return this._url.password;
151
+ },
152
+ set: function (val) {
153
+ /**
154
+ * 1. If context object’s url cannot have a username/password/port, then
155
+ * return.
156
+ * 2. Set the password given context object’s url and the given value.
157
+ */
158
+ if (URLAlgorithm_1.cannotHaveAUsernamePasswordPort(this._url))
159
+ return;
160
+ URLAlgorithm_1.setThePassword(this._url, val);
161
+ },
162
+ enumerable: true,
163
+ configurable: true
164
+ });
165
+ Object.defineProperty(URLImpl.prototype, "host", {
166
+ /** @inheritdoc */
167
+ get: function () {
168
+ /**
169
+ * 1. Let url be context object’s url.
170
+ * 2. If url’s host is null, return the empty string.
171
+ * 3. If url’s port is null, return url’s host, serialized.
172
+ * 4. Return url’s host, serialized, followed by U+003A (:) and url’s port,
173
+ * serialized.
174
+ */
175
+ if (this._url.host === null) {
176
+ return "";
177
+ }
178
+ else if (this._url.port === null) {
179
+ return URLAlgorithm_1.hostSerializer(this._url.host);
180
+ }
181
+ else {
182
+ return URLAlgorithm_1.hostSerializer(this._url.host) + ':' + this._url.port.toString();
183
+ }
184
+ },
185
+ set: function (val) {
186
+ /**
187
+ * 1. If context object’s url’s cannot-be-a-base-URL flag is set, then
188
+ * return.
189
+ * 2. Basic URL parse the given value with context object’s url as url and
190
+ * host state as state override.
191
+ */
192
+ if (this._url._cannotBeABaseURLFlag)
193
+ return;
194
+ URLAlgorithm_1.basicURLParser(val, undefined, undefined, this._url, interfaces_1.ParserState.Host);
195
+ },
196
+ enumerable: true,
197
+ configurable: true
198
+ });
199
+ Object.defineProperty(URLImpl.prototype, "hostname", {
200
+ /** @inheritdoc */
201
+ get: function () {
202
+ /**
203
+ * 1. If context object’s url’s host is null, return the empty string.
204
+ * 2. Return context object’s url’s host, serialized.
205
+ */
206
+ if (this._url.host === null)
207
+ return "";
158
208
  return URLAlgorithm_1.hostSerializer(this._url.host);
159
- }
160
- else {
161
- return URLAlgorithm_1.hostSerializer(this._url.host) + ':' + this._url.port.toString();
162
- }
163
- }
164
- set host(val) {
165
- /**
166
- * 1. If context object’s url’s cannot-be-a-base-URL flag is set, then
167
- * return.
168
- * 2. Basic URL parse the given value with context object’s url as url and
169
- * host state as state override.
170
- */
171
- if (this._url._cannotBeABaseURLFlag)
172
- return;
173
- URLAlgorithm_1.basicURLParser(val, undefined, undefined, this._url, interfaces_1.ParserState.Host);
174
- }
175
- /** @inheritdoc */
176
- get hostname() {
177
- /**
178
- * 1. If context object’s url’s host is null, return the empty string.
179
- * 2. Return context object’s url’s host, serialized.
180
- */
181
- if (this._url.host === null)
182
- return "";
183
- return URLAlgorithm_1.hostSerializer(this._url.host);
184
- }
185
- set hostname(val) {
186
- /**
187
- * 1. If context object’s url’s cannot-be-a-base-URL flag is set, then
188
- * return.
189
- * 2. Basic URL parse the given value with context object’s url as url and
190
- * hostname state as state override.
191
- */
192
- if (this._url._cannotBeABaseURLFlag)
193
- return;
194
- URLAlgorithm_1.basicURLParser(val, undefined, undefined, this._url, interfaces_1.ParserState.Hostname);
195
- }
196
- /** @inheritdoc */
197
- get port() {
198
- /**
199
- * 1. If context object’s url’s port is null, return the empty string.
200
- * 2. Return context object’s url’s port, serialized.
201
- */
202
- if (this._url.port === null)
203
- return "";
204
- return this._url.port.toString();
205
- }
206
- set port(val) {
207
- /**
208
- * 1. If context object’s url cannot have a username/password/port, then
209
- * return.
210
- * 2. If the given value is the empty string, then set context object’s
211
- * url’s port to null.
212
- * 3. Otherwise, basic URL parse the given value with context object’s url
213
- * as url and port state as state override.
214
- */
215
- if (URLAlgorithm_1.cannotHaveAUsernamePasswordPort(this._url))
216
- return;
217
- if (val === "") {
218
- this._url.port = null;
219
- }
220
- else {
221
- URLAlgorithm_1.basicURLParser(val, undefined, undefined, this._url, interfaces_1.ParserState.Port);
222
- }
223
- }
224
- /** @inheritdoc */
225
- get pathname() {
226
- /**
227
- * 1. If context object’s url’s cannot-be-a-base-URL flag is set, then
228
- * return context object’s url’s path[0].
229
- * 2. If context object’s url’s path is empty, then return the empty string.
230
- * 3. Return U+002F (/), followed by the strings in context object’s url’s
231
- * path (including empty strings), if any, separated from each other by
232
- * U+002F (/).
233
- */
234
- if (this._url._cannotBeABaseURLFlag)
235
- return this._url.path[0];
236
- if (this._url.path.length === 0)
237
- return "";
238
- return '/' + this._url.path.join('/');
239
- }
240
- set pathname(val) {
241
- /**
242
- * 1. If context object’s url’s cannot-be-a-base-URL flag is set, then return.
243
- * 2. Empty context object’s url’s path.
244
- * 3. Basic URL parse the given value with context object’s url as url and
245
- * path start state as state override.
246
- */
247
- if (this._url._cannotBeABaseURLFlag)
248
- return;
249
- this._url.path = [];
250
- URLAlgorithm_1.basicURLParser(val, undefined, undefined, this._url, interfaces_1.ParserState.PathStart);
251
- }
252
- /** @inheritdoc */
253
- get search() {
254
- /**
255
- * 1. If context object’s url’s query is either null or the empty string,
256
- * return the empty string.
257
- * 2. Return U+003F (?), followed by context object’s url’s query.
258
- */
259
- if (this._url.query === null || this._url.query === "")
260
- return "";
261
- return '?' + this._url.query;
262
- }
263
- set search(val) {
264
- /**
265
- * 1. Let url be context object’s url.
266
- * 2. If the given value is the empty string, set url’s query to null,
267
- * empty context object’s query object’s list, and then return.
268
- * 3. Let input be the given value with a single leading U+003F (?) removed,
269
- * if any.
270
- * 4. Set url’s query to the empty string.
271
- * 5. Basic URL parse input with url as url and query state as state
272
- * override.
273
- * 6. Set context object’s query object’s list to the result of parsing
274
- * input.
275
- */
276
- const url = this._url;
277
- if (val === "") {
278
- url.query = null;
279
- this._queryObject._list.length = 0;
280
- return;
281
- }
282
- if (val.startsWith('?'))
283
- val = val.substr(1);
284
- url.query = "";
285
- URLAlgorithm_1.basicURLParser(val, undefined, undefined, url, interfaces_1.ParserState.Query);
286
- this._queryObject._list = URLAlgorithm_1.urlEncodedStringParser(val);
287
- }
288
- /** @inheritdoc */
289
- get searchParams() { return this._queryObject; }
290
- /** @inheritdoc */
291
- get hash() {
292
- /**
293
- * 1. If context object’s url’s fragment is either null or the empty string,
294
- * return the empty string.
295
- * 2. Return U+0023 (#), followed by context object’s url’s fragment.
296
- */
297
- if (this._url.fragment === null || this._url.fragment === "")
298
- return "";
299
- return '#' + this._url.fragment;
300
- }
301
- set hash(val) {
302
- /**
303
- * 1. If the given value is the empty string, then set context object’s
304
- * url’s fragment to null and return.
305
- * 2. Let input be the given value with a single leading U+0023 (#) removed,
306
- * if any.
307
- * 3. Set context object’s url’s fragment to the empty string.
308
- * 4. Basic URL parse input with context object’s url as url and fragment
309
- * state as state override.
310
- */
311
- if (val === "") {
312
- this._url.fragment = null;
313
- return;
314
- }
315
- if (val.startsWith('#'))
316
- val = val.substr(1);
317
- this._url.fragment = "";
318
- URLAlgorithm_1.basicURLParser(val, undefined, undefined, this._url, interfaces_1.ParserState.Fragment);
319
- }
209
+ },
210
+ set: function (val) {
211
+ /**
212
+ * 1. If context object’s url’s cannot-be-a-base-URL flag is set, then
213
+ * return.
214
+ * 2. Basic URL parse the given value with context object’s url as url and
215
+ * hostname state as state override.
216
+ */
217
+ if (this._url._cannotBeABaseURLFlag)
218
+ return;
219
+ URLAlgorithm_1.basicURLParser(val, undefined, undefined, this._url, interfaces_1.ParserState.Hostname);
220
+ },
221
+ enumerable: true,
222
+ configurable: true
223
+ });
224
+ Object.defineProperty(URLImpl.prototype, "port", {
225
+ /** @inheritdoc */
226
+ get: function () {
227
+ /**
228
+ * 1. If context object’s url’s port is null, return the empty string.
229
+ * 2. Return context object’s url’s port, serialized.
230
+ */
231
+ if (this._url.port === null)
232
+ return "";
233
+ return this._url.port.toString();
234
+ },
235
+ set: function (val) {
236
+ /**
237
+ * 1. If context object’s url cannot have a username/password/port, then
238
+ * return.
239
+ * 2. If the given value is the empty string, then set context object’s
240
+ * url’s port to null.
241
+ * 3. Otherwise, basic URL parse the given value with context object’s url
242
+ * as url and port state as state override.
243
+ */
244
+ if (URLAlgorithm_1.cannotHaveAUsernamePasswordPort(this._url))
245
+ return;
246
+ if (val === "") {
247
+ this._url.port = null;
248
+ }
249
+ else {
250
+ URLAlgorithm_1.basicURLParser(val, undefined, undefined, this._url, interfaces_1.ParserState.Port);
251
+ }
252
+ },
253
+ enumerable: true,
254
+ configurable: true
255
+ });
256
+ Object.defineProperty(URLImpl.prototype, "pathname", {
257
+ /** @inheritdoc */
258
+ get: function () {
259
+ /**
260
+ * 1. If context object’s url’s cannot-be-a-base-URL flag is set, then
261
+ * return context object’s url’s path[0].
262
+ * 2. If context object’s url’s path is empty, then return the empty string.
263
+ * 3. Return U+002F (/), followed by the strings in context object’s url’s
264
+ * path (including empty strings), if any, separated from each other by
265
+ * U+002F (/).
266
+ */
267
+ if (this._url._cannotBeABaseURLFlag)
268
+ return this._url.path[0];
269
+ if (this._url.path.length === 0)
270
+ return "";
271
+ return '/' + this._url.path.join('/');
272
+ },
273
+ set: function (val) {
274
+ /**
275
+ * 1. If context object’s url’s cannot-be-a-base-URL flag is set, then return.
276
+ * 2. Empty context object’s url’s path.
277
+ * 3. Basic URL parse the given value with context object’s url as url and
278
+ * path start state as state override.
279
+ */
280
+ if (this._url._cannotBeABaseURLFlag)
281
+ return;
282
+ this._url.path = [];
283
+ URLAlgorithm_1.basicURLParser(val, undefined, undefined, this._url, interfaces_1.ParserState.PathStart);
284
+ },
285
+ enumerable: true,
286
+ configurable: true
287
+ });
288
+ Object.defineProperty(URLImpl.prototype, "search", {
289
+ /** @inheritdoc */
290
+ get: function () {
291
+ /**
292
+ * 1. If context object’s url’s query is either null or the empty string,
293
+ * return the empty string.
294
+ * 2. Return U+003F (?), followed by context object’s url’s query.
295
+ */
296
+ if (this._url.query === null || this._url.query === "")
297
+ return "";
298
+ return '?' + this._url.query;
299
+ },
300
+ set: function (val) {
301
+ /**
302
+ * 1. Let url be context object’s url.
303
+ * 2. If the given value is the empty string, set url’s query to null,
304
+ * empty context object’s query object’s list, and then return.
305
+ * 3. Let input be the given value with a single leading U+003F (?) removed,
306
+ * if any.
307
+ * 4. Set url’s query to the empty string.
308
+ * 5. Basic URL parse input with url as url and query state as state
309
+ * override.
310
+ * 6. Set context object’s query object’s list to the result of parsing
311
+ * input.
312
+ */
313
+ var url = this._url;
314
+ if (val === "") {
315
+ url.query = null;
316
+ this._queryObject._list.length = 0;
317
+ return;
318
+ }
319
+ if (val.startsWith('?'))
320
+ val = val.substr(1);
321
+ url.query = "";
322
+ URLAlgorithm_1.basicURLParser(val, undefined, undefined, url, interfaces_1.ParserState.Query);
323
+ this._queryObject._list = URLAlgorithm_1.urlEncodedStringParser(val);
324
+ },
325
+ enumerable: true,
326
+ configurable: true
327
+ });
328
+ Object.defineProperty(URLImpl.prototype, "searchParams", {
329
+ /** @inheritdoc */
330
+ get: function () { return this._queryObject; },
331
+ enumerable: true,
332
+ configurable: true
333
+ });
334
+ Object.defineProperty(URLImpl.prototype, "hash", {
335
+ /** @inheritdoc */
336
+ get: function () {
337
+ /**
338
+ * 1. If context object’s url’s fragment is either null or the empty string,
339
+ * return the empty string.
340
+ * 2. Return U+0023 (#), followed by context object’s url’s fragment.
341
+ */
342
+ if (this._url.fragment === null || this._url.fragment === "")
343
+ return "";
344
+ return '#' + this._url.fragment;
345
+ },
346
+ set: function (val) {
347
+ /**
348
+ * 1. If the given value is the empty string, then set context object’s
349
+ * url’s fragment to null and return.
350
+ * 2. Let input be the given value with a single leading U+0023 (#) removed,
351
+ * if any.
352
+ * 3. Set context object’s url’s fragment to the empty string.
353
+ * 4. Basic URL parse input with context object’s url as url and fragment
354
+ * state as state override.
355
+ */
356
+ if (val === "") {
357
+ this._url.fragment = null;
358
+ return;
359
+ }
360
+ if (val.startsWith('#'))
361
+ val = val.substr(1);
362
+ this._url.fragment = "";
363
+ URLAlgorithm_1.basicURLParser(val, undefined, undefined, this._url, interfaces_1.ParserState.Fragment);
364
+ },
365
+ enumerable: true,
366
+ configurable: true
367
+ });
320
368
  /** @inheritdoc */
321
- toJSON() { return URLAlgorithm_1.urlSerializer(this._url); }
369
+ URLImpl.prototype.toJSON = function () { return URLAlgorithm_1.urlSerializer(this._url); };
322
370
  /** @inheritdoc */
323
- toString() {
371
+ URLImpl.prototype.toString = function () {
324
372
  return this.href;
325
- }
326
- }
373
+ };
374
+ return URLImpl;
375
+ }());
327
376
  exports.URLImpl = URLImpl;
328
377
  //# sourceMappingURL=URLImpl.js.map