Socket
Socket
Sign inDemoInstall

@advanced-rest-client/arc-url

Package Overview
Dependencies
33
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @advanced-rest-client/arc-url

A module with logic an UI regions to support URL processing in Advanced REST Client application. It contains a logic to safely parse url with variables, build a URL input, or to enter any arbitrary URL with autosuggestions.


Version published
Weekly downloads
600
decreased by-11.76%
Maintainers
4
Install size
4.39 MB
Created
Weekly downloads
 

Readme

Source

ARC URL

A module with logic an UI regions to support URL processing in Advanced REST Client application. It contains a logic to safely parse url with variables, build a URL input, or to enter any arbitrary URL with autosuggestions.

Build Status

Usage

Installation

npm install --save @advanced-rest-client/arc-url

UrlParser class

A URL parsing library for Advanced REST Client.

It provides an interface similar to the URL class but it is more relax in terms of input validity. It means that it won't throw an error when the URL is invalid. This allows to use the library in request editors.

Example
import { UrlParser } from '@advanced-rest-client/arc-url';
const parser = new UrlParser('https:///path-with-missing-host?qury=value#string');
console.log(parser.protocol);
console.log(parser.host);
console.log(parser.path);
console.log(parser.searchParams);
console.log(parser.anchor);

web-url-input

An element to render a dialog to enter an URL with auto hints.

Examples
<html>
  <head>
    <script type="module">
      import '@advanced-rest-client/arc-url/web-url-input.js';
      import '@advanced-rest-client/arc-models/url-history-model.js';
    </script>
  </head>
  <body>
    <url-history-model></url-history-model>
    <web-url-input></web-url-input>
  </body>
</html>
import { LitElement, html } from 'lit-element';
import '@advanced-rest-client/arc-url/web-url-input.js';
import '@advanced-rest-client/arc-models/url-history-model.js';

class SampleElement extends LitElement {
  render() {
    return html`
    <url-history-model></url-history-model>
    <web-url-input @open="${this.openHandler}"></web-url-input>
    `;
  }

  openHandler(e) {
    console.log(e.target.value);
  }
}
customElements.define('sample-element', SampleElement);

url-input-editor

A HTTP request URL editor for a HTTP request editor.

URL editor example
import { LitElement, html } from 'lit-element';
import '@advanced-rest-client/arc-url/url-input-editor.js';
import '@advanced-rest-client/arc-models/url-history-model.js';

class SampleElement extends LitElement {
  render() {
    return html`
    <url-history-model></url-history-model>
    <url-input-editor
      .value="${this.url}"
      @change="${this.valueChanged}"
    ></url-input-editor>
    `;
  }

  valueChanged(e) {
    this.url = e.target.value;
  }
}
customElements.define('sample-element', SampleElement);

Development

git clone https://github.com/advanced-rest-client/arc-url
cd arc-url
npm install

Running the tests

npm test

Keywords

FAQs

Last updated on 19 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc