Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@advanced-rest-client/arc-url

Package Overview
Dependencies
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

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.

  • 0.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
400
increased by28.21%
Maintainers
4
Weekly downloads
 
Created
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

Package last updated on 19 Aug 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc