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

@pluginjs/feature

Package Overview
Dependencies
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pluginjs/feature - npm Package Compare versions

Comparing version 0.7.11 to 0.7.12

70

dist/feature.common.js
/*!
* @pluginjs/feature v0.7.11 (https://pluginjs.com)
* @pluginjs/feature v0.7.12 (https://pluginjs.com)
* Copyright 2019 Creation Studio Limited

@@ -17,3 +17,3 @@ * Released under the GPL-3.0 License.

*/
const old = () => Boolean(/(Android\s(1.|2.))|(Silk\/1.)/i.test(navigator.userAgent));
var old = () => Boolean(/(Android\s(1.|2.))|(Silk\/1.)/i.test(navigator.userAgent));
/**

@@ -25,13 +25,13 @@ * Function that takes a standard CSS property name as a parameter and

const pfx = function () {
const prefixes = ['Webkit', 'Moz', 'O', 'ms'];
const memory = {};
const style = document.createElement('dummy').style;
var pfx = function () {
var prefixes = ['Webkit', 'Moz', 'O', 'ms'];
var memory = {};
var style = document.createElement('dummy').style;
return function (prop) {
if (typeof memory[prop] === 'undefined') {
const ucProp = prop.charAt(0).toUpperCase() + prop.substr(1);
const props = "".concat(prop, " ").concat(prefixes.join("".concat(ucProp, " "))).concat(ucProp).split(' ');
var ucProp = prop.charAt(0).toUpperCase() + prop.substr(1);
var props = "".concat(prop, " ").concat(prefixes.join("".concat(ucProp, " "))).concat(ucProp).split(' ');
memory[prop] = null;
for (const i in props) {
for (var i in props) {
if (typeof style[props[i]] !== 'undefined') {

@@ -51,7 +51,7 @@ memory[prop] = props[i];

}
const transitionProperty = () => pfx('transition');
const transformProperty = () => pfx('transform');
const animationProperty = () => pfx('animation');
const transitionEndEvent = () => {
const eventNames = {
var transitionProperty = () => pfx('transition');
var transformProperty = () => pfx('transform');
var animationProperty = () => pfx('animation');
var transitionEndEvent = () => {
var eventNames = {
transition: 'transitionend',

@@ -62,5 +62,5 @@ OTransition: 'oTransitionEnd',

};
const style = document.createElement('dummy').style;
var style = document.createElement('dummy').style;
for (const i in eventNames) {
for (var i in eventNames) {
if (Object.prototype.hasOwnProperty.call(eventNames, i)) {

@@ -75,4 +75,4 @@ if (typeof style[i] !== 'undefined') {

};
const animationEndEvent = () => {
const eventNames = {
var animationEndEvent = () => {
var eventNames = {
animation: 'animationend',

@@ -85,5 +85,5 @@ OAnimation: 'oanimationend',

};
const style = {};
var style = {};
for (const i in eventNames) {
for (var i in eventNames) {
if (Object.prototype.hasOwnProperty.call(eventNames, i)) {

@@ -99,25 +99,25 @@ if (typeof style[i] !== 'undefined') {

const transform3D = () => {
const test = !old() && pfx('perspective') !== null;
var transform3D = () => {
var test = !old() && pfx('perspective') !== null;
return Boolean(test);
}; // Test if CSS transforms are supported
const transform = () => {
const test = !old() && pfx('transformOrigin') !== null;
var transform = () => {
var test = !old() && pfx('transformOrigin') !== null;
return Boolean(test);
}; // Test if CSS transitions are supported
const transition = () => {
const test = pfx('transition') !== null;
var transition = () => {
var test = pfx('transition') !== null;
return Boolean(test);
}; // Test if CSS sticky are supported
const sticky = () => {
let _canSticky = false;
const documentFragment = document.documentElement;
const testElement = document.createElement('div');
var sticky = () => {
var _canSticky = false;
var documentFragment = document.documentElement;
var testElement = document.createElement('div');
documentFragment.appendChild(testElement);
const prefixedSticky = ['sticky', '-webkit-sticky'];
var prefixedSticky = ['sticky', '-webkit-sticky'];
for (let i = 0; i < prefixedSticky.length; i++) {
for (var i = 0; i < prefixedSticky.length; i++) {
testElement.style.position = prefixedSticky[i];

@@ -135,6 +135,6 @@ _canSticky = Boolean(window.getComputedStyle(testElement).position.match('sticky'));

const svg = () => Boolean(document.createElementNS) && Boolean(document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect); // Tests if touch events are supported, but doesn't necessarily reflect a touchscreen device
var svg = () => Boolean(document.createElementNS) && Boolean(document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect); // Tests if touch events are supported, but doesn't necessarily reflect a touchscreen device
const touch = Boolean('ontouchstart' in window || window.navigator && window.navigator.msPointerEnabled && window.MSGesture || window.DocumentTouch && document instanceof DocumentTouch);
const pointer = window.PointerEvent || window.MSPointerEvent ? true : false; // eslint-disable-line no-unneeded-ternary
var touch = Boolean('ontouchstart' in window || window.navigator && window.navigator.msPointerEnabled && window.MSGesture || window.DocumentTouch && document instanceof DocumentTouch);
var pointer = window.PointerEvent || window.MSPointerEvent ? true : false; // eslint-disable-line no-unneeded-ternary

@@ -141,0 +141,0 @@ function pointerEvent(pointerEvent) {

/*!
* @pluginjs/feature v0.7.11 (https://pluginjs.com)
* @pluginjs/feature v0.7.12 (https://pluginjs.com)
* Copyright 2019 Creation Studio Limited
* Released under the GPL-3.0 License.
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const old=()=>Boolean(/(Android\s(1.|2.))|(Silk\/1.)/i.test(navigator.userAgent)),pfx=function(){const t=["Webkit","Moz","O","ms"],n={},o=document.createElement("dummy").style;return function(e){if(void 0===n[e]){const r=e.charAt(0).toUpperCase()+e.substr(1),i="".concat(e," ").concat(t.join("".concat(r," "))).concat(r).split(" ");n[e]=null;for(const t in i)if(void 0!==o[i[t]]){n[e]=i[t];break}}return n[e]}}();function prefixedProperty(t){return pfx(t)}const transitionProperty=()=>pfx("transition"),transformProperty=()=>pfx("transform"),animationProperty=()=>pfx("animation"),transitionEndEvent=()=>{const t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"},n=document.createElement("dummy").style;for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&void 0!==n[o])return t[o];return!1},animationEndEvent=()=>{const t={animation:"animationend",OAnimation:"oanimationend",msAnimation:"MSAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"},n={};for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&void 0!==n[o])return t[o];return!1},transform3D=()=>{const t=!old()&&null!==pfx("perspective");return Boolean(t)},transform=()=>{const t=!old()&&null!==pfx("transformOrigin");return Boolean(t)},transition=()=>{const t=null!==pfx("transition");return Boolean(t)},sticky=()=>{let t=!1;const n=document.documentElement,o=document.createElement("div");n.appendChild(o);const e=["sticky","-webkit-sticky"];for(let n=0;n<e.length&&(o.style.position=e[n],!(t=Boolean(window.getComputedStyle(o).position.match("sticky"))));n++);return n.removeChild(o),t},svg=()=>Boolean(document.createElementNS)&&Boolean(document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect),touch=Boolean("ontouchstart"in window||window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture||window.DocumentTouch&&document instanceof DocumentTouch),pointer=!(!window.PointerEvent&&!window.MSPointerEvent);function pointerEvent(t){return window.MSPointerEvent?"MSPointer".concat(t.charAt(9).toUpperCase()).concat(t.substr(10)):t}exports.animationEndEvent=animationEndEvent,exports.animationProperty=animationProperty,exports.pointer=pointer,exports.pointerEvent=pointerEvent,exports.prefixedProperty=prefixedProperty,exports.sticky=sticky,exports.svg=svg,exports.touch=touch,exports.transform=transform,exports.transform3D=transform3D,exports.transformProperty=transformProperty,exports.transition=transition,exports.transitionEndEvent=transitionEndEvent,exports.transitionProperty=transitionProperty;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var old=()=>Boolean(/(Android\s(1.|2.))|(Silk\/1.)/i.test(navigator.userAgent)),pfx=function(){var t=["Webkit","Moz","O","ms"],n={},o=document.createElement("dummy").style;return function(r){if(void 0===n[r]){var e=r.charAt(0).toUpperCase()+r.substr(1),i="".concat(r," ").concat(t.join("".concat(e," "))).concat(e).split(" ");for(var a in n[r]=null,i)if(void 0!==o[i[a]]){n[r]=i[a];break}}return n[r]}}();function prefixedProperty(t){return pfx(t)}var transitionProperty=()=>pfx("transition"),transformProperty=()=>pfx("transform"),animationProperty=()=>pfx("animation"),transitionEndEvent=()=>{var t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"},n=document.createElement("dummy").style;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&void 0!==n[o])return t[o];return!1},animationEndEvent=()=>{var t={animation:"animationend",OAnimation:"oanimationend",msAnimation:"MSAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"},n={};for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&void 0!==n[o])return t[o];return!1},transform3D=()=>{var t=!old()&&null!==pfx("perspective");return Boolean(t)},transform=()=>{var t=!old()&&null!==pfx("transformOrigin");return Boolean(t)},transition=()=>{var t=null!==pfx("transition");return Boolean(t)},sticky=()=>{var t=!1,n=document.documentElement,o=document.createElement("div");n.appendChild(o);for(var r=["sticky","-webkit-sticky"],e=0;e<r.length&&(o.style.position=r[e],!(t=Boolean(window.getComputedStyle(o).position.match("sticky"))));e++);return n.removeChild(o),t},svg=()=>Boolean(document.createElementNS)&&Boolean(document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect),touch=Boolean("ontouchstart"in window||window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture||window.DocumentTouch&&document instanceof DocumentTouch),pointer=!(!window.PointerEvent&&!window.MSPointerEvent);function pointerEvent(t){return window.MSPointerEvent?"MSPointer".concat(t.charAt(9).toUpperCase()).concat(t.substr(10)):t}exports.animationEndEvent=animationEndEvent,exports.animationProperty=animationProperty,exports.pointer=pointer,exports.pointerEvent=pointerEvent,exports.prefixedProperty=prefixedProperty,exports.sticky=sticky,exports.svg=svg,exports.touch=touch,exports.transform=transform,exports.transform3D=transform3D,exports.transformProperty=transformProperty,exports.transition=transition,exports.transitionEndEvent=transitionEndEvent,exports.transitionProperty=transitionProperty;
/*!
* @pluginjs/feature v0.7.11 (https://pluginjs.com)
* @pluginjs/feature v0.7.12 (https://pluginjs.com)
* Copyright 2019 Creation Studio Limited

@@ -13,3 +13,3 @@ * Released under the GPL-3.0 License.

*/
const old = () => Boolean(/(Android\s(1.|2.))|(Silk\/1.)/i.test(navigator.userAgent));
var old = () => Boolean(/(Android\s(1.|2.))|(Silk\/1.)/i.test(navigator.userAgent));
/**

@@ -21,13 +21,13 @@ * Function that takes a standard CSS property name as a parameter and

const pfx = function () {
const prefixes = ['Webkit', 'Moz', 'O', 'ms'];
const memory = {};
const style = document.createElement('dummy').style;
var pfx = function () {
var prefixes = ['Webkit', 'Moz', 'O', 'ms'];
var memory = {};
var style = document.createElement('dummy').style;
return function (prop) {
if (typeof memory[prop] === 'undefined') {
const ucProp = prop.charAt(0).toUpperCase() + prop.substr(1);
const props = "".concat(prop, " ").concat(prefixes.join("".concat(ucProp, " "))).concat(ucProp).split(' ');
var ucProp = prop.charAt(0).toUpperCase() + prop.substr(1);
var props = "".concat(prop, " ").concat(prefixes.join("".concat(ucProp, " "))).concat(ucProp).split(' ');
memory[prop] = null;
for (const i in props) {
for (var i in props) {
if (typeof style[props[i]] !== 'undefined') {

@@ -47,7 +47,7 @@ memory[prop] = props[i];

}
const transitionProperty = () => pfx('transition');
const transformProperty = () => pfx('transform');
const animationProperty = () => pfx('animation');
const transitionEndEvent = () => {
const eventNames = {
var transitionProperty = () => pfx('transition');
var transformProperty = () => pfx('transform');
var animationProperty = () => pfx('animation');
var transitionEndEvent = () => {
var eventNames = {
transition: 'transitionend',

@@ -58,5 +58,5 @@ OTransition: 'oTransitionEnd',

};
const style = document.createElement('dummy').style;
var style = document.createElement('dummy').style;
for (const i in eventNames) {
for (var i in eventNames) {
if (Object.prototype.hasOwnProperty.call(eventNames, i)) {

@@ -71,4 +71,4 @@ if (typeof style[i] !== 'undefined') {

};
const animationEndEvent = () => {
const eventNames = {
var animationEndEvent = () => {
var eventNames = {
animation: 'animationend',

@@ -81,5 +81,5 @@ OAnimation: 'oanimationend',

};
const style = {};
var style = {};
for (const i in eventNames) {
for (var i in eventNames) {
if (Object.prototype.hasOwnProperty.call(eventNames, i)) {

@@ -95,25 +95,25 @@ if (typeof style[i] !== 'undefined') {

const transform3D = () => {
const test = !old() && pfx('perspective') !== null;
var transform3D = () => {
var test = !old() && pfx('perspective') !== null;
return Boolean(test);
}; // Test if CSS transforms are supported
const transform = () => {
const test = !old() && pfx('transformOrigin') !== null;
var transform = () => {
var test = !old() && pfx('transformOrigin') !== null;
return Boolean(test);
}; // Test if CSS transitions are supported
const transition = () => {
const test = pfx('transition') !== null;
var transition = () => {
var test = pfx('transition') !== null;
return Boolean(test);
}; // Test if CSS sticky are supported
const sticky = () => {
let _canSticky = false;
const documentFragment = document.documentElement;
const testElement = document.createElement('div');
var sticky = () => {
var _canSticky = false;
var documentFragment = document.documentElement;
var testElement = document.createElement('div');
documentFragment.appendChild(testElement);
const prefixedSticky = ['sticky', '-webkit-sticky'];
var prefixedSticky = ['sticky', '-webkit-sticky'];
for (let i = 0; i < prefixedSticky.length; i++) {
for (var i = 0; i < prefixedSticky.length; i++) {
testElement.style.position = prefixedSticky[i];

@@ -131,6 +131,6 @@ _canSticky = Boolean(window.getComputedStyle(testElement).position.match('sticky'));

const svg = () => Boolean(document.createElementNS) && Boolean(document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect); // Tests if touch events are supported, but doesn't necessarily reflect a touchscreen device
var svg = () => Boolean(document.createElementNS) && Boolean(document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect); // Tests if touch events are supported, but doesn't necessarily reflect a touchscreen device
const touch = Boolean('ontouchstart' in window || window.navigator && window.navigator.msPointerEnabled && window.MSGesture || window.DocumentTouch && document instanceof DocumentTouch);
const pointer = window.PointerEvent || window.MSPointerEvent ? true : false; // eslint-disable-line no-unneeded-ternary
var touch = Boolean('ontouchstart' in window || window.navigator && window.navigator.msPointerEnabled && window.MSGesture || window.DocumentTouch && document instanceof DocumentTouch);
var pointer = window.PointerEvent || window.MSPointerEvent ? true : false; // eslint-disable-line no-unneeded-ternary

@@ -137,0 +137,0 @@ function pointerEvent(pointerEvent) {

/*!
* @pluginjs/feature v0.7.11 (https://pluginjs.com)
* @pluginjs/feature v0.7.12 (https://pluginjs.com)
* Copyright 2019 Creation Studio Limited
* Released under the GPL-3.0 License.
*/
const n=()=>Boolean(/(Android\s(1.|2.))|(Silk\/1.)/i.test(navigator.userAgent)),t=function(){const n=["Webkit","Moz","O","ms"],t={},o=document.createElement("dummy").style;return function(e){if(void 0===t[e]){const i=e.charAt(0).toUpperCase()+e.substr(1),r="".concat(e," ").concat(n.join("".concat(i," "))).concat(i).split(" ");t[e]=null;for(const n in r)if(void 0!==o[r[n]]){t[e]=r[n];break}}return t[e]}}();function o(n){return t(n)}const e=()=>t("transition"),i=()=>t("transform"),r=()=>t("animation"),a=()=>{const n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"},t=document.createElement("dummy").style;for(const o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&void 0!==t[o])return n[o];return!1},c=()=>{const n={animation:"animationend",OAnimation:"oanimationend",msAnimation:"MSAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"},t={};for(const o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&void 0!==t[o])return n[o];return!1},s=()=>{const o=!n()&&null!==t("perspective");return Boolean(o)},d=()=>{const o=!n()&&null!==t("transformOrigin");return Boolean(o)},u=()=>{const n=null!==t("transition");return Boolean(n)},m=()=>{let n=!1;const t=document.documentElement,o=document.createElement("div");t.appendChild(o);const e=["sticky","-webkit-sticky"];for(let t=0;t<e.length&&(o.style.position=e[t],!(n=Boolean(window.getComputedStyle(o).position.match("sticky"))));t++);return t.removeChild(o),n},l=()=>Boolean(document.createElementNS)&&Boolean(document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect),w=Boolean("ontouchstart"in window||window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture||window.DocumentTouch&&document instanceof DocumentTouch),p=!(!window.PointerEvent&&!window.MSPointerEvent);function f(n){return window.MSPointerEvent?"MSPointer".concat(n.charAt(9).toUpperCase()).concat(n.substr(10)):n}export{c as animationEndEvent,r as animationProperty,p as pointer,f as pointerEvent,o as prefixedProperty,m as sticky,l as svg,w as touch,d as transform,s as transform3D,i as transformProperty,u as transition,a as transitionEndEvent,e as transitionProperty};
var n,t,o,e=()=>Boolean(/(Android\s(1.|2.))|(Silk\/1.)/i.test(navigator.userAgent)),i=(n=["Webkit","Moz","O","ms"],t={},o=document.createElement("dummy").style,function(e){if(void 0===t[e]){var i=e.charAt(0).toUpperCase()+e.substr(1),r="".concat(e," ").concat(n.join("".concat(i," "))).concat(i).split(" ");for(var a in t[e]=null,r)if(void 0!==o[r[a]]){t[e]=r[a];break}}return t[e]});function r(n){return i(n)}var a=()=>i("transition"),c=()=>i("transform"),s=()=>i("animation"),d=()=>{var n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"},t=document.createElement("dummy").style;for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&void 0!==t[o])return n[o];return!1},m=()=>{var n={animation:"animationend",OAnimation:"oanimationend",msAnimation:"MSAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"},t={};for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&void 0!==t[o])return n[o];return!1},u=()=>{var n=!e()&&null!==i("perspective");return Boolean(n)},l=()=>{var n=!e()&&null!==i("transformOrigin");return Boolean(n)},v=()=>{var n=null!==i("transition");return Boolean(n)},w=()=>{var n=!1,t=document.documentElement,o=document.createElement("div");t.appendChild(o);for(var e=["sticky","-webkit-sticky"],i=0;i<e.length&&(o.style.position=e[i],!(n=Boolean(window.getComputedStyle(o).position.match("sticky"))));i++);return t.removeChild(o),n},p=()=>Boolean(document.createElementNS)&&Boolean(document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect),f=Boolean("ontouchstart"in window||window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture||window.DocumentTouch&&document instanceof DocumentTouch),E=!(!window.PointerEvent&&!window.MSPointerEvent);function y(n){return window.MSPointerEvent?"MSPointer".concat(n.charAt(9).toUpperCase()).concat(n.substr(10)):n}export{m as animationEndEvent,s as animationProperty,E as pointer,y as pointerEvent,r as prefixedProperty,w as sticky,p as svg,f as touch,l as transform,u as transform3D,c as transformProperty,v as transition,d as transitionEndEvent,a as transitionProperty};
/*!
* @pluginjs/feature v0.7.11 (https://pluginjs.com)
* @pluginjs/feature v0.7.12 (https://pluginjs.com)
* Copyright 2019 Creation Studio Limited

@@ -4,0 +4,0 @@ * Released under the GPL-3.0 License.

/*!
* @pluginjs/feature v0.7.11 (https://pluginjs.com)
* @pluginjs/feature v0.7.12 (https://pluginjs.com)
* Copyright 2019 Creation Studio Limited

@@ -4,0 +4,0 @@ * Released under the GPL-3.0 License.

@@ -14,3 +14,3 @@ {

},
"version": "0.7.11",
"version": "0.7.12",
"category": "utils",

@@ -37,5 +37,5 @@ "main": "dist/feature.common.js",

"devDependencies": {
"@babel/core": "^7.4.4",
"@pluginjs/browserslist-config": "^1.2.8",
"@pluginjs/cli": "^0.7.11",
"@babel/core": "^7.5.5",
"@pluginjs/browserslist-config": "^1.2.9",
"@pluginjs/cli": "^0.7.12",
"babel-jest": "*",

@@ -66,4 +66,4 @@ "jest": "*",

],
"gitHead": "99484f02b3c29aa1889cfd1d9f488093295bc359",
"gitHead": "e0247ab4b5e2026b77a390619f2b96bac30609c6",
"title": "Plugin"
}
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