Socket
Book a DemoInstallSign in
Socket

basic-keyboard-event-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

basic-keyboard-event-polyfill

A simple polyfill for KeyboardEvent to help PhantomJS

1.0.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

basic-keyboard-event-polyfill

Build Status

A simple polyfill to help PhantomJS out.

Typlically in JS this is pretty easy to sort out in tests, by creating the event and initialising the Keyboard Event manually. Like in here. However, when running tests for Angular2+ in Typescript you can't just assign a value to the event. They are all readonly. So you can have your tests pass but not linting (if you have --type-check) enabled.

Having this be a package you can just require, means your linting doesn't touch it as it stays in JS land.

Function originally taken from https://github.com/ariya/phantomjs/issues/11289 @runarberg (which was taken from DOM-Keyboard-Event-Level-3-polyfill and modified slightly. I don't actually need the full polyfill hence this light weight JS that can be loaded via NPM outside of the tslint and typechecking.

Install for dev via:

  • npm install basic-keyboard-event-polyfill --save-dev
  • yarn add basic-keyboard-event-polyfill --dev

Keywords

keyboardevent

FAQs

Package last updated on 01 Mar 2017

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.