@codebolt/codeboltjs 1.1.68 → 1.1.69
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/.codeboltconfig.yaml +0 -0
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/_internal_.Agent.html +43 -39
- package/docs/classes/_internal_.ClientRequest.html +57 -57
- package/docs/classes/_internal_.Codebolt.html +151 -117
- package/docs/classes/_internal_.CustomEventEmitter-1.html +30 -30
- package/docs/classes/_internal_.CustomEventEmitter.html +30 -30
- package/docs/classes/_internal_.Duplex.html +30 -30
- package/docs/classes/_internal_.EventEmitter-1.html +30 -30
- package/docs/classes/_internal_.EventEmitter.EventEmitterAsyncResource.html +34 -34
- package/docs/classes/_internal_.IncomingMessage.html +57 -55
- package/docs/classes/_internal_.KeyObject.html +10 -10
- package/docs/classes/_internal_.OutgoingMessage.html +41 -41
- package/docs/classes/_internal_.Readable.html +28 -28
- package/docs/classes/_internal_.ReadableBase.html +27 -27
- package/docs/classes/_internal_.Server-1.html +32 -32
- package/docs/classes/_internal_.Server-2.html +24 -24
- package/docs/classes/_internal_.Server-3.html +24 -24
- package/docs/classes/_internal_.Server.html +42 -42
- package/docs/classes/_internal_.ServerResponse.html +50 -50
- package/docs/classes/_internal_.Socket.html +28 -28
- package/docs/classes/_internal_.Stream.html +28 -28
- package/docs/classes/_internal_.TLSSocket.html +29 -29
- package/docs/classes/_internal_.URL.html +19 -19
- package/docs/classes/_internal_.URLSearchParams.html +15 -15
- package/docs/classes/_internal_.WebSocket-1.html +23 -23
- package/docs/classes/_internal_.WebSocket.Server.html +23 -23
- package/docs/classes/_internal_.Writable.html +24 -24
- package/docs/classes/_internal_.WritableBase.html +23 -23
- package/docs/classes/_internal_.X509Certificate.html +26 -26
- package/docs/classes/_internal_.internal-1.html +29 -29
- package/docs/classes/_internal_.internal.PassThrough.html +30 -30
- package/docs/classes/_internal_.internal.Transform.html +30 -30
- package/docs/enums/_internal_.logType.html +2 -2
- package/docs/functions/_internal_.internal.addAbortSignal.html +2 -2
- package/docs/functions/_internal_.internal.finished-1.html +1 -1
- package/docs/functions/_internal_.internal.pipeline-1.html +1 -1
- package/docs/interfaces/_internal_.AgentOptions.html +8 -8
- package/docs/interfaces/_internal_.AsymmetricKeyDetails.html +8 -8
- package/docs/interfaces/_internal_.Buffer.html +19 -19
- package/docs/interfaces/_internal_.CryptoKey.html +5 -5
- package/docs/interfaces/_internal_.DuplexOptions.html +1 -1
- package/docs/interfaces/_internal_.EventEmitter-2.html +17 -17
- package/docs/interfaces/_internal_.EventEmitter.Abortable.html +2 -2
- package/docs/interfaces/_internal_.EventEmitter.EventEmitterAsyncResourceOptions.html +2 -2
- package/docs/interfaces/_internal_.EventEmitter.EventEmitterReferencingAsyncResource.html +2 -2
- package/docs/interfaces/_internal_.ExtractTextResponse.html +3 -0
- package/docs/interfaces/_internal_.GetContentResponse.html +3 -0
- package/docs/interfaces/_internal_.InformationEvent.html +2 -2
- package/docs/interfaces/_internal_.JsonWebKey.html +2 -2
- package/docs/interfaces/_internal_.JwkKeyExportOptions.html +2 -2
- package/docs/interfaces/_internal_.KeyAlgorithm.html +2 -2
- package/docs/interfaces/_internal_.KeyExportOptions.html +2 -2
- package/docs/interfaces/_internal_.ListenOptions.html +1 -1
- package/docs/interfaces/_internal_.LookupAddress.html +3 -3
- package/docs/interfaces/_internal_.LookupOptions.html +12 -5
- package/docs/interfaces/_internal_.ReadWriteStream.html +16 -16
- package/docs/interfaces/_internal_.ReadableOptions.html +1 -1
- package/docs/interfaces/_internal_.ReadableStream-1.html +16 -16
- package/docs/interfaces/_internal_.Selection.html +6 -0
- package/docs/interfaces/_internal_.ServerOptions.html +7 -8
- package/docs/interfaces/_internal_.StaticEventEmitterOptions.html +15 -2
- package/docs/interfaces/_internal_.StreamOptions.html +1 -1
- package/docs/interfaces/_internal_.UserMessage.html +3 -0
- package/docs/interfaces/_internal_.UserRequest.html +7 -0
- package/docs/interfaces/_internal_.WebSocket.WebSocket.html +11 -11
- package/docs/interfaces/_internal_.WebSocket.WebSocketServer.html +11 -11
- package/docs/interfaces/_internal_.WebSocketAlias.html +11 -11
- package/docs/interfaces/_internal_.WritableOptions.html +1 -1
- package/docs/interfaces/_internal_.WritableStream.html +16 -16
- package/docs/interfaces/_internal_.X509CheckOptions.html +6 -6
- package/docs/interfaces/_internal_.internal.FinishedOptions.html +1 -1
- package/docs/interfaces/_internal_.internal.TransformOptions.html +1 -1
- package/docs/modules/_internal_.EventEmitter.html +1 -1
- package/docs/modules/_internal_.html +5 -2
- package/docs/types/_internal_.AnyRest.html +1 -1
- package/docs/types/_internal_.Args.html +1 -1
- package/docs/types/_internal_.BinaryLike.html +1 -1
- package/docs/types/_internal_.DefaultEventMap.html +1 -1
- package/docs/types/_internal_.EventMap.html +1 -1
- package/docs/types/_internal_.Key.html +1 -1
- package/docs/types/_internal_.Key2.html +1 -1
- package/docs/types/_internal_.KeyFormat.html +1 -1
- package/docs/types/_internal_.KeyObjectType.html +1 -1
- package/docs/types/_internal_.KeyType-1.html +1 -1
- package/docs/types/_internal_.KeyType.html +1 -1
- package/docs/types/_internal_.KeyUsage.html +1 -1
- package/docs/types/_internal_.Listener.html +1 -1
- package/docs/types/_internal_.RequestListener.html +1 -1
- package/docs/variables/default.html +1 -1
- package/index.d.ts +1 -1
- package/modules/codeutils.d.ts +1 -1
- package/modules/codeutils.js +64 -94
- package/package.json +1 -3
- package/src/modules/codeutils.ts +67 -67
- package/docs/interfaces/_internal_.CommandOutput.html +0 -3
- package/docs/interfaces/_internal_.GetJsTreeResponse.html +0 -3
|
@@ -7,7 +7,7 @@ data properties on the object itself. Thus, unlike <code>legacy urlObject</code>
|
|
|
7
7
|
using the <code>delete</code> keyword on any properties of <code>URL</code> objects (e.g. <code>delete myURL.protocol</code>, <code>delete myURL.pathname</code>, etc) has no effect but will still
|
|
8
8
|
return <code>true</code>.</p>
|
|
9
9
|
</div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v7.0.0, v6.13.0</p>
|
|
10
|
-
</div></section><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
10
|
+
</div></section><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:390</li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="_internal_.URL.html#constructor" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
|
11
11
|
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="_internal_.URL.html#hash" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>hash</span></a>
|
|
12
12
|
<a href="_internal_.URL.html#host" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>host</span></a>
|
|
13
13
|
<a href="_internal_.URL.html#hostname" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>hostname</span></a>
|
|
@@ -25,45 +25,45 @@ return <code>true</code>.</p>
|
|
|
25
25
|
<a href="_internal_.URL.html#canParse" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>can<wbr/>Parse</span></a>
|
|
26
26
|
<a href="_internal_.URL.html#createObjectURL" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>ObjectURL</span></a>
|
|
27
27
|
<a href="_internal_.URL.html#revokeObjectURL" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>revoke<wbr/>ObjectURL</span></a>
|
|
28
|
-
</div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-is-external"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_URL" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new URL</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">input</span>, <span class="tsd-kind-parameter">base</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.URL.html" class="tsd-signature-type tsd-kind-class">URL</a><a href="#constructor.new_URL" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">input</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">toString</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">base</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><a href="_internal_.URL.html" class="tsd-signature-type tsd-kind-class">URL</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.URL.html" class="tsd-signature-type tsd-kind-class">URL</a></h4><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
28
|
+
</div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-is-external"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_URL" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new URL</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">input</span>, <span class="tsd-kind-parameter">base</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_internal_.URL.html" class="tsd-signature-type tsd-kind-class">URL</a><a href="#constructor.new_URL" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">input</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">toString</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">base</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><a href="_internal_.URL.html" class="tsd-signature-type tsd-kind-class">URL</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_internal_.URL.html" class="tsd-signature-type tsd-kind-class">URL</a></h4><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:440</li></ul></aside></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-is-external"><a id="hash" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>hash</span><a href="#hash" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">hash</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Gets and sets the fragment portion of the URL.</p>
|
|
29
29
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myURL</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">URL</span><span class="hl-1">(</span><span class="hl-2">'https://example.org/foo#bar'</span><span class="hl-1">);</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">hash</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints #bar</span><br/><br/><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">hash</span><span class="hl-1"> = </span><span class="hl-2">'baz'</span><span class="hl-1">;</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">href</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints https://example.org/foo#baz</span>
|
|
30
30
|
</code><button>Copy</button></pre>
|
|
31
31
|
<p>Invalid URL characters included in the value assigned to the <code>hash</code> property
|
|
32
32
|
are <code>percent-encoded</code>. The selection of which characters to
|
|
33
33
|
percent-encode may vary somewhat from what the parse and format methods would produce.</p>
|
|
34
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
34
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:458</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="host" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>host</span><a href="#host" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">host</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Gets and sets the host portion of the URL.</p>
|
|
35
35
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myURL</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">URL</span><span class="hl-1">(</span><span class="hl-2">'https://example.org:81/foo'</span><span class="hl-1">);</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">host</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints example.org:81</span><br/><br/><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">host</span><span class="hl-1"> = </span><span class="hl-2">'example.com:82'</span><span class="hl-1">;</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">href</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints https://example.com:82/foo</span>
|
|
36
36
|
</code><button>Copy</button></pre>
|
|
37
37
|
<p>Invalid host values assigned to the <code>host</code> property are ignored.</p>
|
|
38
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
38
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:474</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="hostname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>hostname</span><a href="#hostname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">hostname</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Gets and sets the host name portion of the URL. The key difference between<code>url.host</code> and <code>url.hostname</code> is that <code>url.hostname</code> does <em>not</em> include the
|
|
39
39
|
port.</p>
|
|
40
40
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myURL</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">URL</span><span class="hl-1">(</span><span class="hl-2">'https://example.org:81/foo'</span><span class="hl-1">);</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">hostname</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints example.org</span><br/><br/><span class="hl-5">// Setting the hostname does not change the port</span><br/><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">hostname</span><span class="hl-1"> = </span><span class="hl-2">'example.com'</span><span class="hl-1">;</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">href</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints https://example.com:81/foo</span><br/><br/><span class="hl-5">// Use myURL.host to change the hostname and port</span><br/><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">host</span><span class="hl-1"> = </span><span class="hl-2">'example.org:82'</span><span class="hl-1">;</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">href</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints https://example.org:82/foo</span>
|
|
41
41
|
</code><button>Copy</button></pre>
|
|
42
42
|
<p>Invalid host name values assigned to the <code>hostname</code> property are ignored.</p>
|
|
43
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
43
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:497</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="href" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>href</span><a href="#href" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">href</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Gets and sets the serialized URL.</p>
|
|
44
44
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myURL</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">URL</span><span class="hl-1">(</span><span class="hl-2">'https://example.org/foo'</span><span class="hl-1">);</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">href</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints https://example.org/foo</span><br/><br/><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">href</span><span class="hl-1"> = </span><span class="hl-2">'https://example.com/bar'</span><span class="hl-1">;</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">href</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints https://example.com/bar</span>
|
|
45
45
|
</code><button>Copy</button></pre>
|
|
46
46
|
<p>Getting the value of the <code>href</code> property is equivalent to calling <a href="_internal_.URL.html#toString" class="tsd-kind-method">toString</a>.</p>
|
|
47
47
|
<p>Setting the value of this property to a new value is equivalent to creating a
|
|
48
48
|
new <code>URL</code> object using <code>new URL(value)</code>. Each of the <code>URL</code> object's properties will be modified.</p>
|
|
49
49
|
<p>If the value assigned to the <code>href</code> property is not a valid URL, a <code>TypeError</code> will be thrown.</p>
|
|
50
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
50
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:518</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="origin" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>origin</span><a href="#origin" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">origin</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Gets the read-only serialization of the URL's origin.</p>
|
|
51
51
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myURL</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">URL</span><span class="hl-1">(</span><span class="hl-2">'https://example.org/foo/bar?baz'</span><span class="hl-1">);</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">origin</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints https://example.org</span>
|
|
52
52
|
</code><button>Copy</button></pre>
|
|
53
53
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">idnURL</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">URL</span><span class="hl-1">(</span><span class="hl-2">'https://測試'</span><span class="hl-1">);</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">idnURL</span><span class="hl-1">.</span><span class="hl-7">origin</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints https://xn--g6w251d</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">idnURL</span><span class="hl-1">.</span><span class="hl-7">hostname</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints xn--g6w251d</span>
|
|
54
54
|
</code><button>Copy</button></pre>
|
|
55
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
55
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:537</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="password" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>password</span><a href="#password" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">password</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Gets and sets the password portion of the URL.</p>
|
|
56
56
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myURL</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">URL</span><span class="hl-1">(</span><span class="hl-2">'https://abc:xyz@example.com'</span><span class="hl-1">);</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">password</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints xyz</span><br/><br/><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">password</span><span class="hl-1"> = </span><span class="hl-2">'123'</span><span class="hl-1">;</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">href</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints https://abc:123@example.com/</span>
|
|
57
57
|
</code><button>Copy</button></pre>
|
|
58
58
|
<p>Invalid URL characters included in the value assigned to the <code>password</code> property
|
|
59
59
|
are <code>percent-encoded</code>. The selection of which characters to
|
|
60
60
|
percent-encode may vary somewhat from what the parse and format methods would produce.</p>
|
|
61
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
61
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:555</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="pathname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>pathname</span><a href="#pathname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">pathname</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Gets and sets the path portion of the URL.</p>
|
|
62
62
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myURL</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">URL</span><span class="hl-1">(</span><span class="hl-2">'https://example.org/abc/xyz?123'</span><span class="hl-1">);</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">pathname</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints /abc/xyz</span><br/><br/><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">pathname</span><span class="hl-1"> = </span><span class="hl-2">'/abcdef'</span><span class="hl-1">;</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">href</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints https://example.org/abcdef?123</span>
|
|
63
63
|
</code><button>Copy</button></pre>
|
|
64
64
|
<p>Invalid URL characters included in the value assigned to the <code>pathname</code> property are <code>percent-encoded</code>. The selection of which characters
|
|
65
65
|
to percent-encode may vary somewhat from what the parse and format methods would produce.</p>
|
|
66
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
66
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:572</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="port" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>port</span><a href="#port" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">port</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Gets and sets the port portion of the URL.</p>
|
|
67
67
|
<p>The port value may be a number or a string containing a number in the range <code>0</code> to <code>65535</code> (inclusive). Setting the value to the default port of the <code>URL</code> objects given <code>protocol</code> will
|
|
68
68
|
result in the <code>port</code> value becoming
|
|
69
69
|
the empty string (<code>''</code>).</p>
|
|
@@ -85,16 +85,16 @@ Leading numbers up to the decimal point will be set as the URL's port,
|
|
|
85
85
|
assuming they are valid:</p>
|
|
86
86
|
<pre><code class="language-js"><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">port</span><span class="hl-1"> = </span><span class="hl-9">4.567e21</span><span class="hl-1">;</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">port</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints 4 (because it is the leading number in the string '4.567e21')</span>
|
|
87
87
|
</code><button>Copy</button></pre>
|
|
88
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
88
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:645</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="protocol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>protocol</span><a href="#protocol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">protocol</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Gets and sets the protocol portion of the URL.</p>
|
|
89
89
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myURL</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">URL</span><span class="hl-1">(</span><span class="hl-2">'https://example.org'</span><span class="hl-1">);</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">protocol</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints https:</span><br/><br/><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">protocol</span><span class="hl-1"> = </span><span class="hl-2">'ftp'</span><span class="hl-1">;</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">href</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints ftp://example.org/</span>
|
|
90
90
|
</code><button>Copy</button></pre>
|
|
91
91
|
<p>Invalid URL protocol values assigned to the <code>protocol</code> property are ignored.</p>
|
|
92
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
92
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:661</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="search" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>search</span><a href="#search" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">search</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Gets and sets the serialized query portion of the URL.</p>
|
|
93
93
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myURL</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">URL</span><span class="hl-1">(</span><span class="hl-2">'https://example.org/abc?123'</span><span class="hl-1">);</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">search</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints ?123</span><br/><br/><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">search</span><span class="hl-1"> = </span><span class="hl-2">'abc=xyz'</span><span class="hl-1">;</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">href</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints https://example.org/abc?abc=xyz</span>
|
|
94
94
|
</code><button>Copy</button></pre>
|
|
95
95
|
<p>Any invalid URL characters appearing in the value assigned the <code>search</code> property will be <code>percent-encoded</code>. The selection of which
|
|
96
96
|
characters to percent-encode may vary somewhat from what the parse and format methods would produce.</p>
|
|
97
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
97
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:678</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="searchParams" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadonly">Readonly</code> <span>search<wbr/>Params</span><a href="#searchParams" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">search<wbr/>Params</span><span class="tsd-signature-symbol">:</span> <a href="_internal_.URLSearchParams.html" class="tsd-signature-type tsd-kind-class">URLSearchParams</a></div><div class="tsd-comment tsd-typography"><p>Gets the <code>URLSearchParams</code> object representing the query parameters of the
|
|
98
98
|
URL. This property is read-only but the <code>URLSearchParams</code> object it provides
|
|
99
99
|
can be used to mutate the URL instance; to replace the entirety of query
|
|
100
100
|
parameters of the URL, use the <a href="_internal_.URL.html#search" class="tsd-kind-property">search</a> setter. See <code>URLSearchParams</code> documentation for details.</p>
|
|
@@ -105,27 +105,27 @@ instance, the <code>URL</code> object will not percent encode the ASCII tilde (<
|
|
|
105
105
|
character, while <code>URLSearchParams</code> will always encode it:</p>
|
|
106
106
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myURL</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">URL</span><span class="hl-1">(</span><span class="hl-2">'https://example.org/abc?foo=~bar'</span><span class="hl-1">);</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">search</span><span class="hl-1">); </span><span class="hl-5">// prints ?foo=~bar</span><br/><br/><span class="hl-5">// Modify the URL via searchParams...</span><br/><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">searchParams</span><span class="hl-1">.</span><span class="hl-0">sort</span><span class="hl-1">();</span><br/><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">search</span><span class="hl-1">); </span><span class="hl-5">// prints ?foo=%7Ebar</span>
|
|
107
107
|
</code><button>Copy</button></pre>
|
|
108
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
108
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:702</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-external"><a id="username" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>username</span><a href="#username" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">username</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Gets and sets the username portion of the URL.</p>
|
|
109
109
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myURL</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">URL</span><span class="hl-1">(</span><span class="hl-2">'https://abc:xyz@example.com'</span><span class="hl-1">);</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">username</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints abc</span><br/><br/><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">username</span><span class="hl-1"> = </span><span class="hl-2">'123'</span><span class="hl-1">;</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">myURL</span><span class="hl-1">.</span><span class="hl-7">href</span><span class="hl-1">);</span><br/><span class="hl-5">// Prints https://123:xyz@example.com/</span>
|
|
110
110
|
</code><button>Copy</button></pre>
|
|
111
111
|
<p>Any invalid URL characters appearing in the value assigned the <code>username</code> property will be <code>percent-encoded</code>. The selection of which
|
|
112
112
|
characters to percent-encode may vary somewhat from what the parse and format methods would produce.</p>
|
|
113
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
113
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:719</li></ul></aside></section></section><section class="tsd-panel-group tsd-member-group"><h2>Methods</h2><section class="tsd-panel tsd-member tsd-is-external"><a id="toJSON" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>toJSON</span><a href="#toJSON" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="toJSON.toJSON-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">toJSON</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><a href="#toJSON.toJSON-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>The <code>toJSON()</code> method on the <code>URL</code> object returns the serialized URL. The
|
|
114
114
|
value returned is equivalent to that of <a href="_internal_.URL.html#href" class="tsd-kind-property">href</a> and <a href="_internal_.URL.html#toString" class="tsd-kind-method">toString</a>.</p>
|
|
115
115
|
<p>This method is automatically called when an <code>URL</code> object is serialized
|
|
116
116
|
with <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify"><code>JSON.stringify()</code></a>.</p>
|
|
117
117
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">myURLs</span><span class="hl-1"> = [</span><br/><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">URL</span><span class="hl-1">(</span><span class="hl-2">'https://www.example.com'</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">URL</span><span class="hl-1">(</span><span class="hl-2">'https://test.example.org'</span><span class="hl-1">),</span><br/><span class="hl-1">];</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-4">JSON</span><span class="hl-1">.</span><span class="hl-0">stringify</span><span class="hl-1">(</span><span class="hl-7">myURLs</span><span class="hl-1">));</span><br/><span class="hl-5">// Prints ["https://www.example.com/","https://test.example.org/"]</span>
|
|
118
118
|
</code><button>Copy</button></pre>
|
|
119
|
-
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
119
|
+
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:741</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="toString" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>to<wbr/>String</span><a href="#toString" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="toString.toString-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">to<wbr/>String</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><a href="#toString.toString-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>The <code>toString()</code> method on the <code>URL</code> object returns the serialized URL. The
|
|
120
120
|
value returned is equivalent to that of <a href="_internal_.URL.html#href" class="tsd-kind-property">href</a> and <a href="_internal_.URL.html#toJSON" class="tsd-kind-method">toJSON</a>.</p>
|
|
121
|
-
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
121
|
+
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:724</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="canParse" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>can<wbr/>Parse</span><a href="#canParse" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="canParse.canParse-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">can<wbr/>Parse</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">input</span>, <span class="tsd-kind-parameter">base</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#canParse.canParse-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Checks if an <code>input</code> relative to the <code>base</code> can be parsed to a <code>URL</code>.</p>
|
|
122
122
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">isValid</span><span class="hl-1"> = </span><span class="hl-4">URL</span><span class="hl-1">.</span><span class="hl-0">canParse</span><span class="hl-1">(</span><span class="hl-2">'/foo'</span><span class="hl-1">, </span><span class="hl-2">'https://example.org/'</span><span class="hl-1">); </span><span class="hl-5">// true</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">isNotValid</span><span class="hl-1"> = </span><span class="hl-4">URL</span><span class="hl-1">.</span><span class="hl-0">canParse</span><span class="hl-1">(</span><span class="hl-2">'/foo'</span><span class="hl-1">); </span><span class="hl-5">// false</span>
|
|
123
123
|
</code><button>Copy</button></pre>
|
|
124
124
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">input</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The absolute or relative input URL to parse. If <code>input</code> is relative, then <code>base</code> is required. If <code>input</code> is absolute, the <code>base</code> is ignored. If <code>input</code> is not a string, it is
|
|
125
125
|
<code>converted to a string</code> first.</p>
|
|
126
126
|
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">base</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The base URL to resolve against if the <code>input</code> is not absolute. If <code>base</code> is not a string, it is <code>converted to a string</code> first.</p>
|
|
127
127
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v19.9.0</p>
|
|
128
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
128
|
+
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:439</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="createObjectURL" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>create<wbr/>ObjectURL</span><a href="#createObjectURL" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="createObjectURL.createObjectURL-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">create<wbr/>ObjectURL</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">blob</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><a href="#createObjectURL.createObjectURL-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><code class="tsd-tag ts-flagExperimental">Experimental</code> <div class="tsd-comment tsd-typography"><p>Creates a <code>'blob:nodedata:...'</code> URL string that represents the given <code>Blob</code> object and can be used to retrieve the <code>Blob</code> later.</p>
|
|
129
129
|
<pre><code class="language-js"><span class="hl-3">const</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">Blob</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">resolveObjectURL</span><span class="hl-1">,</span><br/><span class="hl-1">} = </span><span class="hl-0">require</span><span class="hl-1">(</span><span class="hl-2">'node:buffer'</span><span class="hl-1">);</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">blob</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Blob</span><span class="hl-1">([</span><span class="hl-2">'hello'</span><span class="hl-1">]);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">id</span><span class="hl-1"> = </span><span class="hl-4">URL</span><span class="hl-1">.</span><span class="hl-0">createObjectURL</span><span class="hl-1">(</span><span class="hl-7">blob</span><span class="hl-1">);</span><br/><br/><span class="hl-5">// later...</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-4">otherBlob</span><span class="hl-1"> = </span><span class="hl-0">resolveObjectURL</span><span class="hl-1">(</span><span class="hl-7">id</span><span class="hl-1">);</span><br/><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-7">otherBlob</span><span class="hl-1">.</span><span class="hl-7">size</span><span class="hl-1">);</span>
|
|
130
130
|
</code><button>Copy</button></pre>
|
|
131
131
|
<p>The data stored by the registered <code>Blob</code> will be retained in memory until <code>URL.revokeObjectURL()</code> is called to remove it.</p>
|
|
@@ -133,8 +133,8 @@ value returned is equivalent to that of <a href="_internal_.URL.html#href" class
|
|
|
133
133
|
Threads, <code>Blob</code> objects registered within one Worker will not be available
|
|
134
134
|
to other workers or the main thread.</p>
|
|
135
135
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">blob</span>: <a href="_internal_.Blob.html" class="tsd-signature-type tsd-kind-class">Blob</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v16.7.0</p>
|
|
136
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
136
|
+
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:417</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-external"><a id="revokeObjectURL" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>revoke<wbr/>ObjectURL</span><a href="#revokeObjectURL" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="revokeObjectURL.revokeObjectURL-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">revoke<wbr/>ObjectURL</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">id</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#revokeObjectURL.revokeObjectURL-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><code class="tsd-tag ts-flagExperimental">Experimental</code> <div class="tsd-comment tsd-typography"><p>Removes the stored <code>Blob</code> identified by the given ID. Attempting to revoke a
|
|
137
137
|
ID that isn't registered will silently fail.</p>
|
|
138
138
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">id</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>A <code>'blob:nodedata:...</code> URL string returned by a prior call to <code>URL.createObjectURL()</code>.</p>
|
|
139
139
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v16.7.0</p>
|
|
140
|
-
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:
|
|
140
|
+
</div><aside class="tsd-sources"><ul><li>Defined in node_modules/@types/node/url.d.ts:425</li></ul></aside></li></ul></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#constructor" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a><a href="#hash" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>hash</span></a><a href="#host" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>host</span></a><a href="#hostname" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>hostname</span></a><a href="#href" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>href</span></a><a href="#origin" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>origin</span></a><a href="#password" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>password</span></a><a href="#pathname" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>pathname</span></a><a href="#port" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>port</span></a><a href="#protocol" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>protocol</span></a><a href="#search" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>search</span></a><a href="#searchParams" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>search<wbr/>Params</span></a><a href="#username" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>username</span></a><a href="#toJSON" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>toJSON</span></a><a href="#toString" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>to<wbr/>String</span></a><a href="#canParse" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>can<wbr/>Parse</span></a><a href="#createObjectURL" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>ObjectURL</span></a><a href="#revokeObjectURL" class="tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>revoke<wbr/>ObjectURL</span></a></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@codebolt/codeboltjs</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|