@advanced-rest-client/headers-parser-mixin
TypeScript icon, indicating that this package has built-in type declarations

3.2.0 • Public • Published

Published on NPM

Build Status

Published on webcomponents.org

headers-parser-mixin

Headers parser mixin function to be implemented with elements that parses HTTP headers.

Mixin deprecation notice

The mixing is being deprecated and implementation should move to use HeadersParser module instead.

Usage

Installation

npm install --save @advanced-rest-client/headers-parser-mixin

As ES module

import * as HeadersParser from '@advanced-rest-client/headers-parser-mixin';
const errorMessage = HeadersParser.getError('Whitespace Name: x-true');

In a LitElement

import { LitElement, html } from 'lit-element';
import { HeadersParserMixin } from '@advanced-rest-client/headers-parser-mixin';

class SampleElement extends HeadersParserMixin(LitElement) {
  render() {
    const validation = this.getHeaderError('Whitespace Name: x-true');
    return html`
    ${validation ? html`<p>${validation}<p>` : html`<p>Headers are valid</p>`}
    `;
  }
}
customElements.define('sample-element', SampleElement);

Development

git clone https://github.com/advanced-rest-client/headers-parser-mixin
cd headers-parser-mixin
npm install

Running the demo locally

npm start

Running the tests

npm test

Package Sidebar

Install

npm i @advanced-rest-client/headers-parser-mixin

Weekly Downloads

690

Version

3.2.0

License

Apache-2.0

Unpacked Size

68.4 kB

Total Files

13

Last publish

Collaborators

  • carowright
  • jarrodek
  • twoplustwoone
  • lbauret