New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@advanced-rest-client/content-type-selector

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@advanced-rest-client/content-type-selector

A content type dropdown to select request CT header

  • 3.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
306
decreased by-40.12%
Maintainers
4
Weekly downloads
 
Created
Source

content-type-selector

An element that provides an UI for selecting common content type values.

<content-type-selector contenttype="application/zip">
  <paper-item slot="item" data-type="application/zip">Zip file</paper-item>
  <paper-item slot="item" data-type="application/7z">7-zip file</paper-item>
</content-type-selector>

Published on NPM

Tests and publishing

Usage

Installation

npm install --save @advanced-rest-client/content-type-selector

In an html file

<html>
  <head>
    <script type="module">
      import '@advanced-rest-client/content-type-selector/content-type-selector.js';
    </script>
    <script src="node_modules/web-animations-js/web-animations-next.min.js"></script>
  </head>
  <body>
    <content-type-selector contenttype="application/json"></content-type-selector>
    <script>
    window.addEventListener('content-type-changed', (e) => {
      console.log(e.detail.value);
    });
    </script>
  </body>
</html>

In a LitElement template

import { LitElement, html } from 'lit-element';
import '@advanced-rest-client/content-type-selector/content-type-selector.js';

class SampleElement extends LitElement {
  render() {
    return html`
    <content-type-selector .contentType="${this.mediaType}" @contenttype-changed="${this._mediaChangeHandler}"></content-type-selector>
    `;
  }

  _mediaChangeHandler(e) {
    console.log(e.target.contentType);
    // or e.detail.value
  }
}
customElements.define('sample-element', SampleElement);

In a Polymer 3 element

import {PolymerElement, html} from '@polymer/polymer';
import '@advanced-rest-client/content-type-selector/content-type-selector.js';

class SampleElement extends PolymerElement {
  static get template() {
    return html`
    <content-type-selector contenttype="{{mediaType}}"></content-type-selector>
    `;
  }
}
customElements.define('sample-element', SampleElement);

Development

git clone https://github.com/advanced-rest-client/content-type-selector
cd content-type-selector
npm install

Running the demo locally

npm start

Running the tests

npm test

Keywords

FAQs

Package last updated on 05 Jan 2022

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