hyTags
HomeHome DocumentationDocumentation

url-delete

Deletes a component from a URL and returns a new URL
Parameter
Type
Description
self
Url
The URL to modify
component
String
The component to delete ('host', 'port', 'path', 'query', or 'anchor')
return
url
A new URL with the specified component removed
Test Case:Delete URL port
    <div></div>
    
    <url-from-string string="https://example.com:8080/path">
    <url-delete component="port">
    <url-to-string>
    <assert-equal value="https://example.com/path" type="string">
    
    👆 Try to change something!
  • Test Case:Delete URL anchor
      <div></div>
      
      <url-from-string string="https://example.com/path#section">
      <url-delete component="anchor">
      <url-to-string>
      <assert-equal value="https://example.com/path" type="string">
      
      👆 Try to change something!
    • Test succeeded Test failed