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

events-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

events-polyfill - npm Package Compare versions

Comparing version 2.0.5 to 2.0.6

9

index.js

@@ -693,7 +693,6 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

Object.defineProperty(
PointerEvent.prototype,
'twist',
Object.getOwnPropertyDescriptor(PointerEvent.prototype, 'rotation')
);
var rotationDescriptor = Object.getOwnPropertyDescriptor(PointerEvent.prototype, 'rotation');
if (rotationDescriptior) {
Object.defineProperty(PointerEvent.prototype, 'twist', rotationDescriptor);
}

@@ -700,0 +699,0 @@ window.PointerEvent = PointerEvent;

@@ -1,1 +0,1 @@

(function e(t,n,i){function r(s,a){if(!n[s]){if(!t[s]){var l=typeof require=="function"&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var p=new Error("Cannot find module '"+s+"'");throw p.code="MODULE_NOT_FOUND",p}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n?n:e)},u,u.exports,e,t,n,i)}return n[s].exports}var o=typeof require=="function"&&require;for(var s=0;s<i.length;s++)r(i[s]);return r})({1:[function(e,t,n){t.exports=function(){if(typeof EventTarget==="undefined"){window.EventTarget=Node}var e={interceptors:[]};e.getRegisteredEventListener=function(e,t){var n=t.type+"-"+(t.options.capture?"1":"0");if(e.__eventListeners!==void 0&&e.__eventListeners[n]!==void 0){var i=e.__eventListeners[n];for(var r=0;r<i.length;r++){if(i[r].listener===t.listener){return i[r]}}}return null};e.registerEventListener=function(e,t){var n=t.type+"-"+(t.options.capture?"1":"0");if(e.__eventListeners===void 0){e.__eventListeners={}}if(e.__eventListeners[n]===void 0){e.__eventListeners[n]=[]}e.__eventListeners[n].push(t)};e.unregisterEventListener=function(e,t){var n=t.type+"-"+(t.options.capture?"1":"0");if(e.__eventListeners!==void 0&&e.__eventListeners[n]!==void 0){var i=e.__eventListeners[n];for(var r=0;r<i.length;r++){if(i[r].listener===t.listener){i.splice(r,1)}}if(i.length===0){delete e.__eventListeners[n]}}};e.normalizeListenerCallback=function(e){if(typeof e==="function"){return e}else if(typeof e==="object"&&typeof e.handleEvent==="function"){return e.handleEvent}else{return function(t){e(t)}}};e.normalizeListenerOptions=function(e){switch(typeof e){case"boolean":e={capture:e};break;case"undefined":e={capture:false};break;case"object":break;default:throw new Error("Unsupported options type for addEventListener")}e.once=Boolean(e.once);e.passive=Boolean(e.passive);e.capture=Boolean(e.capture);return e};e.normalizeListenerArguments=function(e,t,n){return{type:e,listener:this.normalizeListenerCallback(t),options:this.normalizeListenerOptions(n)}};e.intercept=function(e,t){var n=null;for(var i=0;i<this.interceptors.length;i++){if(this.interceptors[i].target===e){n=this.interceptors[i]}}if(n===null){n={target:e,interceptors:[t]};this.interceptors.push(n);this.interceptAddEventListener(e,n);this.interceptRemoveEventListener(e,n)}else{n.interceptors.push(t)}};e.interceptAddEventListener=function(e,t){var n=this;var i=e.prototype.addEventListener;e.prototype.addEventListener=function(e,r,o){var s=n.normalizeListenerArguments(e,r,o);var a=n.getRegisteredEventListener(this,s);if(!a){s.polyfilled={type:s.type,listener:s.listener,options:{capture:s.options.capture,once:s.options.once,passive:s.options.passive}};for(var l=0;l<t.interceptors.length;l++){var p=t.interceptors[l];if(typeof p.add==="function"){p.add(s)}}n.registerEventListener(this,s);i.call(this,s.polyfilled.type,s.polyfilled.listener,s.polyfilled.options)}};return function(){e.prototype.addEventListener=i}};e.interceptRemoveEventListener=function(e,t){var n=this;var i=e.prototype.removeEventListener;e.prototype.removeEventListener=function(e,t,r){var o=n.normalizeListenerArguments(e,t,r);var s=n.getRegisteredEventListener(this,o);if(s){n.unregisterEventListener(this,o);i.call(this,s.polyfilled.type,s.polyfilled.listener,s.polyfilled.options)}else{i.call(this,e,t,r)}};return function(){e.prototype.removeEventListener=i}};e.interceptAll=function(e){this.intercept(EventTarget,e);if(!(window instanceof EventTarget)){this.intercept(Window,e)}};e.releaseAll=function(){for(var e=0,t=this.interceptors.length;e<t;e++){this.interceptors()}};e.error=function(e){console.error(e)};return e}()},{}],2:[function(e,t,n){(function(e){e.isSupportedOnEvent=function(e,t){return"on"+t in e};e.isSupportedTransitionEvent=function(t,n){return e.isSupportedOnEvent(t,n)||"style"in t&&t.style["transition"]!==void 0};e.isSupportedFullScreenEvent=function(t,n){if(e.isSupportedOnEvent(t,n)){return true}else{if(/^ms/.test(n.toLowerCase())){return"msRequestFullscreen"in document.body}else if(/^moz/.test(n)){return"mozRequestFullscreen"in document.body}else if(/^webkit/.test(n)){return"webkitRequestFullscreen"in document.body}else{return false}}};e.generateEventTypes=function(){var e=this;this.eventTypes={};this.vendorPrefixes=["","webkit","moz","ms","o"];this.eventTypes["wheel"]=["wheel","mousewheel","DOMMouseScroll"].map(function(t){return{type:t,isSupported:e.isSupportedOnEvent}});this.eventTypes["fullscreenchange"]=["fullscreenchange","mozfullscreenchange","webkitfullscreenchange","MSFullscreenChange","msfullscreenchange"].map(function(t){return{type:t,isSupported:e.isSupportedFullScreenEvent}});this.eventTypes["fullscreenerror"]=["fullscreenerror","mozfullscreenerror","webkitfullscreenerror","MSFullscreenError","msfullscreenerror"].map(function(t){return{type:t,isSupported:e.isSupportedFullScreenEvent}});["pointerlockchange","pointerlockerror","animationstart","animationiteration","animationend","pointercancel","pointerdown","pointerhover","pointermove","pointerout","pointerover","pointerup"].forEach(function(t){e.eventTypes[t]=e.vendorPrefixes.map(function(n){return{type:n+t,isSupported:e.isSupportedOnEvent}})});["transitionstart","transitionrun","transitionend"].forEach(function(t){e.eventTypes[t]=e.vendorPrefixes.map(function(n){return{type:n+t,isSupported:e.isSupportedTransitionEvent}})})};e.getSupportedEventType=function(e,t){var n=this.eventTypes[t];if(n===void 0){return t}else{var i;for(var r=0;r<n.length;r++){i=n[r];if(i.isSupported(e,i.type)){return i.type}}return t}};e.polyfillListenerEventTypes=function(){this.generateEventTypes();var e=this;this.interceptAll({add:function(t){t.polyfilled.type=e.getSupportedEventType(this,t.polyfilled.type)}})};e.polyfillListenerEventTypes()})(e("./EventListenerInterceptor.js"))},{"./EventListenerInterceptor.js":1}],3:[function(e,t,n){(function(e){e.detectSupportedOptions=function(){var e=this;this.supportedOptions={once:false,passive:false,capture:false,all:false,some:false};document.createDocumentFragment().addEventListener("test",function(){},{get once(){e.supportedOptions.once=true;return false},get passive(){e.supportedOptions.passive=true;return false},get capture(){e.supportedOptions.capture=true;return false}});this.supportedOptions.all=this.supportedOptions.once&&this.supportedOptions.passive&&this.supportedOptions.capture;this.supportedOptions.some=this.supportedOptions.once||this.supportedOptions.passive||this.supportedOptions.capture};e.polyfillListenerOptions=function(){this.detectSupportedOptions();if(!this.supportedOptions.all){var e=this;this.interceptAll({add:function(t){var n=t.options.once&&!e.supportedOptions.once;var i=t.options.passive&&!e.supportedOptions.passive;if(n||i){var r=t.polyfilled.listener;t.polyfilled.listener=function(e){if(n){this.removeEventListener(t.type,t.listener,t.options)}if(i){e.preventDefault=function(){throw new Error("Unable to preventDefault inside passive event listener invocation.")}}return r.call(this,e)}}if(!e.supportedOptions.some){t.polyfilled.options=t.options.capture}}})}};e.polyfillListenerOptions()})(e("./EventListenerInterceptor.js"))},{"./EventListenerInterceptor.js":1}],4:[function(e,t,n){(function(){try{var e=new window.CustomEvent("event",{bubbles:true,cancelable:true})}catch(e){var t=window.CustomEvent||window.Event;var n=function(e,t){t=t||{};var n=document.createEvent("CustomEvent");n.initCustomEvent(e,t.bubbles===void 0?false:t.bubbles,t.cancelable===void 0?false:t.cancelable,t.detail===void 0?{}:t.detail);return n};n.prototype=t.prototype;window.CustomEvent=n}})()},{}],5:[function(e,t,n){(function(){try{var e=new window.Event("event",{bubbles:true,cancelable:true})}catch(e){var t=window.Event;var n=function(e,t){t=t||{};var n=document.createEvent("Event");n.initEvent(e,t.bubbles===void 0?false:t.bubbles,t.cancelable===void 0?false:t.cancelable,t.detail===void 0?{}:t.detail);return n};n.prototype=t.prototype;window.Event=n}})()},{}],6:[function(e,t,n){(function(){try{var e=new window.FocusEvent("event",{bubbles:true,cancelable:true})}catch(e){var t=window.FocusEvent||window.Event;var n=function(e,t){t=t||{};var n=document.createEvent("FocusEvent");n.initFocusEvent(e,t.bubbles===void 0?false:t.bubbles,t.cancelable===void 0?false:t.cancelable,t.view===void 0?window:t.view,t.detail===void 0?{}:t.detail,t.relatedTarget===void 0?null:t.relatedTarget);return n};n.prototype=t.prototype;window.FocusEvent=n}})()},{}],7:[function(e,t,n){(function(){try{var e=new window.KeyboardEvent("event",{bubbles:true,cancelable:true})}catch(e){var t=window.KeyboardEvent||window.Event;var n=function(e,t){t=t||{};var n=document.createEvent("KeyboardEvent");n.initKeyboardEvent(e,t.bubbles===void 0?false:t.bubbles,t.cancelable===void 0?false:t.cancelable,t.view===void 0?window:t.view,t.key===void 0?"":t.key,t.location===void 0?0:t.location,(t.ctrlKey===true?"Control ":"")+(t.altKey===true?"Alt ":"")+(t.shiftKey===true?"Shift ":"")+(t.metaKey===true?"Meta ":""),t.repeat===void 0?false:t.repeat,t.locale===void 0?navigator.language:t.locale);n.keyCode=t.keyCode===void 0?0:t.keyCode;n.code=t.code===void 0?"":t.code;n.charCode=t.charCode===void 0?0:t.charCode;n.char=t.charCode===void 0?"":t.charCode;n.which=t.which===void 0?0:t.which;return n};n.prototype=t.prototype;window.KeyboardEvent=n}})()},{}],8:[function(e,t,n){(function(){try{var e=new window.MouseEvent("event",{bubbles:true,cancelable:true})}catch(e){var t=window.MouseEvent||window.Event;var n=function(e,t){t=t||{};var n=document.createEvent("MouseEvent");n.initMouseEvent(e,t.bubbles===void 0?false:t.bubbles,t.cancelable===void 0?false:t.cancelable,t.view===void 0?window:t.view,t.detail===void 0?0:t.detail,t.screenX===void 0?0:t.screenX,t.screenY===void 0?0:t.screenY,t.clientX===void 0?0:t.clientX,t.clientY===void 0?0:t.clientY,t.ctrlKey===void 0?false:t.ctrlKey,t.altKey===void 0?false:t.altKey,t.shiftKey===void 0?false:t.shiftKey,t.metaKey===void 0?false:t.metaKey,t.button===void 0?0:t.button,t.relatedTarget===void 0?null:t.relatedTarget);n.buttons=t.buttons===void 0?0:t.buttons;n.region=t.region===void 0?null:t.region;return n};n.prototype=t.prototype;window.MouseEvent=n}})()},{}],9:[function(e,t,n){(function(){try{var e=new window.PointerEvent("event",{bubbles:true,cancelable:true})}catch(e){var t=window.PointerEvent||window.Event;var n=function(e,t){t=t||{};var n=document.createEvent("PointerEvent");n.initPointerEvent(e,t.bubbles===void 0?false:t.bubbles,t.cancelable===void 0?false:t.cancelable,t.view===void 0?window:t.view,t.detail===void 0?0:t.detail,t.screenX===void 0?0:t.screenX,t.screenY===void 0?0:t.screenY,t.clientX===void 0?0:t.clientX,t.clientY===void 0?0:t.clientY,t.ctrlKey===void 0?false:t.ctrlKey,t.altKey===void 0?false:t.altKey,t.shiftKey===void 0?false:t.shiftKey,t.metaKey===void 0?false:t.metaKey,t.button===void 0?0:t.button,t.relatedTarget===void 0?null:t.relatedTarget,t.offsetX===void 0?0:t.offsetX,t.offsetY===void 0?0:t.offsetY,t.width===void 0?1:t.width,t.height===void 0?1:t.height,t.pressure===void 0?0:t.pressure,t.twist===void 0?0:t.twist,t.tiltX===void 0?0:t.tiltX,t.tiltY===void 0?0:t.tiltY,t.pointerId===void 0?0:t.pointerId,t.pointerType===void 0?"":t.pointerType,t.hwTimestamp===void 0?0:t.hwTimestamp,t.isPrimary===void 0?false:t.isPrimary);n.tangentialPressure=t.tangentialPressure===void 0?0:t.tangentialPressure;return n};n.prototype=t.prototype;Object.defineProperty(n.prototype,"twist",Object.getOwnPropertyDescriptor(n.prototype,"rotation"));window.PointerEvent=n}})()},{}],10:[function(e,t,n){e("./Event.js");e("./CustomEvent.js");e("./MouseEvent.js");e("./KeyboardEvent.js");e("./FocusEvent.js");e("./PointerEvent.js")},{"./CustomEvent.js":4,"./Event.js":5,"./FocusEvent.js":6,"./KeyboardEvent.js":7,"./MouseEvent.js":8,"./PointerEvent.js":9}],11:[function(e,t,n){e("./constructors/index.js");e("./ListenerOptions.js");e("./ListenerEventTypes.js")},{"./ListenerEventTypes.js":2,"./ListenerOptions.js":3,"./constructors/index.js":10}]},{},[11]);
(function e(t,n,i){function r(s,a){if(!n[s]){if(!t[s]){var l=typeof require=="function"&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var p=new Error("Cannot find module '"+s+"'");throw p.code="MODULE_NOT_FOUND",p}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return r(n?n:e)},u,u.exports,e,t,n,i)}return n[s].exports}var o=typeof require=="function"&&require;for(var s=0;s<i.length;s++)r(i[s]);return r})({1:[function(e,t,n){t.exports=function(){if(typeof EventTarget==="undefined"){window.EventTarget=Node}var e={interceptors:[]};e.getRegisteredEventListener=function(e,t){var n=t.type+"-"+(t.options.capture?"1":"0");if(e.__eventListeners!==void 0&&e.__eventListeners[n]!==void 0){var i=e.__eventListeners[n];for(var r=0;r<i.length;r++){if(i[r].listener===t.listener){return i[r]}}}return null};e.registerEventListener=function(e,t){var n=t.type+"-"+(t.options.capture?"1":"0");if(e.__eventListeners===void 0){e.__eventListeners={}}if(e.__eventListeners[n]===void 0){e.__eventListeners[n]=[]}e.__eventListeners[n].push(t)};e.unregisterEventListener=function(e,t){var n=t.type+"-"+(t.options.capture?"1":"0");if(e.__eventListeners!==void 0&&e.__eventListeners[n]!==void 0){var i=e.__eventListeners[n];for(var r=0;r<i.length;r++){if(i[r].listener===t.listener){i.splice(r,1)}}if(i.length===0){delete e.__eventListeners[n]}}};e.normalizeListenerCallback=function(e){if(typeof e==="function"){return e}else if(typeof e==="object"&&typeof e.handleEvent==="function"){return e.handleEvent}else{return function(t){e(t)}}};e.normalizeListenerOptions=function(e){switch(typeof e){case"boolean":e={capture:e};break;case"undefined":e={capture:false};break;case"object":break;default:throw new Error("Unsupported options type for addEventListener")}e.once=Boolean(e.once);e.passive=Boolean(e.passive);e.capture=Boolean(e.capture);return e};e.normalizeListenerArguments=function(e,t,n){return{type:e,listener:this.normalizeListenerCallback(t),options:this.normalizeListenerOptions(n)}};e.intercept=function(e,t){var n=null;for(var i=0;i<this.interceptors.length;i++){if(this.interceptors[i].target===e){n=this.interceptors[i]}}if(n===null){n={target:e,interceptors:[t]};this.interceptors.push(n);this.interceptAddEventListener(e,n);this.interceptRemoveEventListener(e,n)}else{n.interceptors.push(t)}};e.interceptAddEventListener=function(e,t){var n=this;var i=e.prototype.addEventListener;e.prototype.addEventListener=function(e,r,o){var s=n.normalizeListenerArguments(e,r,o);var a=n.getRegisteredEventListener(this,s);if(!a){s.polyfilled={type:s.type,listener:s.listener,options:{capture:s.options.capture,once:s.options.once,passive:s.options.passive}};for(var l=0;l<t.interceptors.length;l++){var p=t.interceptors[l];if(typeof p.add==="function"){p.add(s)}}n.registerEventListener(this,s);i.call(this,s.polyfilled.type,s.polyfilled.listener,s.polyfilled.options)}};return function(){e.prototype.addEventListener=i}};e.interceptRemoveEventListener=function(e,t){var n=this;var i=e.prototype.removeEventListener;e.prototype.removeEventListener=function(e,t,r){var o=n.normalizeListenerArguments(e,t,r);var s=n.getRegisteredEventListener(this,o);if(s){n.unregisterEventListener(this,o);i.call(this,s.polyfilled.type,s.polyfilled.listener,s.polyfilled.options)}else{i.call(this,e,t,r)}};return function(){e.prototype.removeEventListener=i}};e.interceptAll=function(e){this.intercept(EventTarget,e);if(!(window instanceof EventTarget)){this.intercept(Window,e)}};e.releaseAll=function(){for(var e=0,t=this.interceptors.length;e<t;e++){this.interceptors()}};e.error=function(e){console.error(e)};return e}()},{}],2:[function(e,t,n){(function(e){e.isSupportedOnEvent=function(e,t){return"on"+t in e};e.isSupportedTransitionEvent=function(t,n){return e.isSupportedOnEvent(t,n)||"style"in t&&t.style["transition"]!==void 0};e.isSupportedFullScreenEvent=function(t,n){if(e.isSupportedOnEvent(t,n)){return true}else{if(/^ms/.test(n.toLowerCase())){return"msRequestFullscreen"in document.body}else if(/^moz/.test(n)){return"mozRequestFullscreen"in document.body}else if(/^webkit/.test(n)){return"webkitRequestFullscreen"in document.body}else{return false}}};e.generateEventTypes=function(){var e=this;this.eventTypes={};this.vendorPrefixes=["","webkit","moz","ms","o"];this.eventTypes["wheel"]=["wheel","mousewheel","DOMMouseScroll"].map(function(t){return{type:t,isSupported:e.isSupportedOnEvent}});this.eventTypes["fullscreenchange"]=["fullscreenchange","mozfullscreenchange","webkitfullscreenchange","MSFullscreenChange","msfullscreenchange"].map(function(t){return{type:t,isSupported:e.isSupportedFullScreenEvent}});this.eventTypes["fullscreenerror"]=["fullscreenerror","mozfullscreenerror","webkitfullscreenerror","MSFullscreenError","msfullscreenerror"].map(function(t){return{type:t,isSupported:e.isSupportedFullScreenEvent}});["pointerlockchange","pointerlockerror","animationstart","animationiteration","animationend","pointercancel","pointerdown","pointerhover","pointermove","pointerout","pointerover","pointerup"].forEach(function(t){e.eventTypes[t]=e.vendorPrefixes.map(function(n){return{type:n+t,isSupported:e.isSupportedOnEvent}})});["transitionstart","transitionrun","transitionend"].forEach(function(t){e.eventTypes[t]=e.vendorPrefixes.map(function(n){return{type:n+t,isSupported:e.isSupportedTransitionEvent}})})};e.getSupportedEventType=function(e,t){var n=this.eventTypes[t];if(n===void 0){return t}else{var i;for(var r=0;r<n.length;r++){i=n[r];if(i.isSupported(e,i.type)){return i.type}}return t}};e.polyfillListenerEventTypes=function(){this.generateEventTypes();var e=this;this.interceptAll({add:function(t){t.polyfilled.type=e.getSupportedEventType(this,t.polyfilled.type)}})};e.polyfillListenerEventTypes()})(e("./EventListenerInterceptor.js"))},{"./EventListenerInterceptor.js":1}],3:[function(e,t,n){(function(e){e.detectSupportedOptions=function(){var e=this;this.supportedOptions={once:false,passive:false,capture:false,all:false,some:false};document.createDocumentFragment().addEventListener("test",function(){},{get once(){e.supportedOptions.once=true;return false},get passive(){e.supportedOptions.passive=true;return false},get capture(){e.supportedOptions.capture=true;return false}});this.supportedOptions.all=this.supportedOptions.once&&this.supportedOptions.passive&&this.supportedOptions.capture;this.supportedOptions.some=this.supportedOptions.once||this.supportedOptions.passive||this.supportedOptions.capture};e.polyfillListenerOptions=function(){this.detectSupportedOptions();if(!this.supportedOptions.all){var e=this;this.interceptAll({add:function(t){var n=t.options.once&&!e.supportedOptions.once;var i=t.options.passive&&!e.supportedOptions.passive;if(n||i){var r=t.polyfilled.listener;t.polyfilled.listener=function(e){if(n){this.removeEventListener(t.type,t.listener,t.options)}if(i){e.preventDefault=function(){throw new Error("Unable to preventDefault inside passive event listener invocation.")}}return r.call(this,e)}}if(!e.supportedOptions.some){t.polyfilled.options=t.options.capture}}})}};e.polyfillListenerOptions()})(e("./EventListenerInterceptor.js"))},{"./EventListenerInterceptor.js":1}],4:[function(e,t,n){(function(){try{var e=new window.CustomEvent("event",{bubbles:true,cancelable:true})}catch(e){var t=window.CustomEvent||window.Event;var n=function(e,t){t=t||{};var n=document.createEvent("CustomEvent");n.initCustomEvent(e,t.bubbles===void 0?false:t.bubbles,t.cancelable===void 0?false:t.cancelable,t.detail===void 0?{}:t.detail);return n};n.prototype=t.prototype;window.CustomEvent=n}})()},{}],5:[function(e,t,n){(function(){try{var e=new window.Event("event",{bubbles:true,cancelable:true})}catch(e){var t=window.Event;var n=function(e,t){t=t||{};var n=document.createEvent("Event");n.initEvent(e,t.bubbles===void 0?false:t.bubbles,t.cancelable===void 0?false:t.cancelable,t.detail===void 0?{}:t.detail);return n};n.prototype=t.prototype;window.Event=n}})()},{}],6:[function(e,t,n){(function(){try{var e=new window.FocusEvent("event",{bubbles:true,cancelable:true})}catch(e){var t=window.FocusEvent||window.Event;var n=function(e,t){t=t||{};var n=document.createEvent("FocusEvent");n.initFocusEvent(e,t.bubbles===void 0?false:t.bubbles,t.cancelable===void 0?false:t.cancelable,t.view===void 0?window:t.view,t.detail===void 0?{}:t.detail,t.relatedTarget===void 0?null:t.relatedTarget);return n};n.prototype=t.prototype;window.FocusEvent=n}})()},{}],7:[function(e,t,n){(function(){try{var e=new window.KeyboardEvent("event",{bubbles:true,cancelable:true})}catch(e){var t=window.KeyboardEvent||window.Event;var n=function(e,t){t=t||{};var n=document.createEvent("KeyboardEvent");n.initKeyboardEvent(e,t.bubbles===void 0?false:t.bubbles,t.cancelable===void 0?false:t.cancelable,t.view===void 0?window:t.view,t.key===void 0?"":t.key,t.location===void 0?0:t.location,(t.ctrlKey===true?"Control ":"")+(t.altKey===true?"Alt ":"")+(t.shiftKey===true?"Shift ":"")+(t.metaKey===true?"Meta ":""),t.repeat===void 0?false:t.repeat,t.locale===void 0?navigator.language:t.locale);n.keyCode=t.keyCode===void 0?0:t.keyCode;n.code=t.code===void 0?"":t.code;n.charCode=t.charCode===void 0?0:t.charCode;n.char=t.charCode===void 0?"":t.charCode;n.which=t.which===void 0?0:t.which;return n};n.prototype=t.prototype;window.KeyboardEvent=n}})()},{}],8:[function(e,t,n){(function(){try{var e=new window.MouseEvent("event",{bubbles:true,cancelable:true})}catch(e){var t=window.MouseEvent||window.Event;var n=function(e,t){t=t||{};var n=document.createEvent("MouseEvent");n.initMouseEvent(e,t.bubbles===void 0?false:t.bubbles,t.cancelable===void 0?false:t.cancelable,t.view===void 0?window:t.view,t.detail===void 0?0:t.detail,t.screenX===void 0?0:t.screenX,t.screenY===void 0?0:t.screenY,t.clientX===void 0?0:t.clientX,t.clientY===void 0?0:t.clientY,t.ctrlKey===void 0?false:t.ctrlKey,t.altKey===void 0?false:t.altKey,t.shiftKey===void 0?false:t.shiftKey,t.metaKey===void 0?false:t.metaKey,t.button===void 0?0:t.button,t.relatedTarget===void 0?null:t.relatedTarget);n.buttons=t.buttons===void 0?0:t.buttons;n.region=t.region===void 0?null:t.region;return n};n.prototype=t.prototype;window.MouseEvent=n}})()},{}],9:[function(e,t,n){(function(){try{var e=new window.PointerEvent("event",{bubbles:true,cancelable:true})}catch(e){var t=window.PointerEvent||window.Event;var n=function(e,t){t=t||{};var n=document.createEvent("PointerEvent");n.initPointerEvent(e,t.bubbles===void 0?false:t.bubbles,t.cancelable===void 0?false:t.cancelable,t.view===void 0?window:t.view,t.detail===void 0?0:t.detail,t.screenX===void 0?0:t.screenX,t.screenY===void 0?0:t.screenY,t.clientX===void 0?0:t.clientX,t.clientY===void 0?0:t.clientY,t.ctrlKey===void 0?false:t.ctrlKey,t.altKey===void 0?false:t.altKey,t.shiftKey===void 0?false:t.shiftKey,t.metaKey===void 0?false:t.metaKey,t.button===void 0?0:t.button,t.relatedTarget===void 0?null:t.relatedTarget,t.offsetX===void 0?0:t.offsetX,t.offsetY===void 0?0:t.offsetY,t.width===void 0?1:t.width,t.height===void 0?1:t.height,t.pressure===void 0?0:t.pressure,t.twist===void 0?0:t.twist,t.tiltX===void 0?0:t.tiltX,t.tiltY===void 0?0:t.tiltY,t.pointerId===void 0?0:t.pointerId,t.pointerType===void 0?"":t.pointerType,t.hwTimestamp===void 0?0:t.hwTimestamp,t.isPrimary===void 0?false:t.isPrimary);n.tangentialPressure=t.tangentialPressure===void 0?0:t.tangentialPressure;return n};n.prototype=t.prototype;var i=Object.getOwnPropertyDescriptor(n.prototype,"rotation");if(rotationDescriptior){Object.defineProperty(n.prototype,"twist",i)}window.PointerEvent=n}})()},{}],10:[function(e,t,n){e("./Event.js");e("./CustomEvent.js");e("./MouseEvent.js");e("./KeyboardEvent.js");e("./FocusEvent.js");e("./PointerEvent.js")},{"./CustomEvent.js":4,"./Event.js":5,"./FocusEvent.js":6,"./KeyboardEvent.js":7,"./MouseEvent.js":8,"./PointerEvent.js":9}],11:[function(e,t,n){e("./constructors/index.js");e("./ListenerOptions.js");e("./ListenerEventTypes.js")},{"./ListenerEventTypes.js":2,"./ListenerOptions.js":3,"./constructors/index.js":10}]},{},[11]);
{
"name": "events-polyfill",
"version": "2.0.5",
"version": "2.0.6",
"description": "Polyfill event : EventListener, EventTarget, Event, CustomEvent, MouseEvent, KeyboardEvent, FocusEvent, PointerEvent and add support for options (like 'once')",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -62,7 +62,6 @@ (function() {

Object.defineProperty(
PointerEvent.prototype,
'twist',
Object.getOwnPropertyDescriptor(PointerEvent.prototype, 'rotation')
);
var rotationDescriptor = Object.getOwnPropertyDescriptor(PointerEvent.prototype, 'rotation');
if (rotationDescriptior) {
Object.defineProperty(PointerEvent.prototype, 'twist', rotationDescriptor);
}

@@ -69,0 +68,0 @@ window.PointerEvent = PointerEvent;

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