Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

bss

Package Overview
Dependencies
0
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.4 to 1.0.5

10

bss.js

@@ -44,5 +44,11 @@ (function (global, factory) {

var style = window.getComputedStyle(document.documentElement, null);
var cssProperties = Object.keys(
findWidth(document.documentElement.style)
).filter(function (prop) { return typeof document.documentElement.style[prop] === 'string'; });
var cssProperties = Array.prototype.slice.call(style, 0, style.length).map(hyphenToCamelCase);
function findWidth(obj) {
return obj.hasOwnProperty('width')
? obj
: findWidth(Object.getPrototypeOf(obj))
}

@@ -49,0 +55,0 @@ var vendorMap = Object.create(null, {});

2

bss.min.js

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.b=e()}(this,function(){"use strict";function t(t,e){var n;return"string"==typeof t?"string"==typeof e||"number"==typeof e?(n={},n[t]=e,n):c(t):Array.isArray(t)&&Array.isArray(t.raw)?(arguments[0]={raw:t},c(String.raw.apply(null,arguments))):t.style||function(t){return Object.keys(t).reduce(function(e,n){var r=t[n];return r||0===r||""===r?("content"===n&&'"'!==r.charAt(0)?e[n]='"'+r+'"':e[n in b?b[n]:n]=a(n,r),e):e},{})}(t)}function e(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}function n(t){return t.slice("-"===t.charAt(0)?1:0).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})}function r(t){var e=function(t){return t.charAt(0)+(t.match(/([A-Z])/g)||[]).join("").toLowerCase()}(t),n=d[e]&&d[e]!==t?t:e;return y[n]=t,n}function i(t){var e={},n=[],r=!1;return Object.keys(t).forEach(function(c){"@"===c.charAt(0)?n.push(c+"{"+i(t[c])+"}"):" "===c.charAt(0)||":"===c.charAt(0)?n.push(o(".$"+c,t[c])):(e[c]=t[c],r=!0)}),r&&n.unshift(o(".$",e)),n}function o(t,e){return t+"{"+function(t){return Object.keys(t).map(function(e){return function(t,e){return(v.test(e)?"-":"")+function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}(e)+":"+t[e]+";"}(t,e)}).join("")}("string"==typeof e?c(e):e)+"}"}function c(t){return t.replace(/;/g,"\n").split("\n").reduce(function(t,e){var r=e.trim().split(/[: ]/);if(r.length>1){var i=n(r.shift().trim());t[y[i]||i]=a(y[i]||i,r.join(" ").trim())}return t},{})}function a(t,e){return e+(isNaN(e)?"":j(t))}function u(t,e){if($.push(t),x)return w.textContent+=t;O&&O.insertRule(t,arguments.length>1?e:O.cssRules.length)}function l(n,r){return e(l.style,t.apply(null,arguments)),s(l)}function s(t){var e=Object.create(l,{style:{value:t.style}});return t===l&&(l.style={}),e}function f(t){return function(e){return e||0===e?arguments.length>0&&(this.style[t]=1===arguments.length?a(t,e):Array.prototype.slice.call(arguments).map(function(e){return a(t,e)}).join(" ")):delete this.style[t],s(this)}}function p(e,n){if(1===arguments.length)return Object.keys(e).forEach(function(t){return p(t,e[t])});u(o(e,t(n)),0)}function h(n,r){return 1===arguments.length?Object.keys(n).forEach(function(t){return h(t,n[t])}):"object"==typeof r?(delete l[n],void Object.defineProperty(l,n,{get:function(){return e(this.style,t(r)),s(this)}})):void(l[n]=function(){var t=r.apply(null,arguments);return e(this.style,t.style),s(this)})}var d={ai:"alignItems",b:"bottom",bc:"backgroundColor",br:"borderRadius",bs:"boxShadow",c:"color",d:"display",f:"float",fd:"flexDirection",ff:"fontFamily",fs:"fontSize",h:"height",jc:"justifyContent",l:"left",ls:"letterSpacing",m:"margin",mb:"marginBottom",ml:"marginLeft",mr:"marginRight",mt:"marginTop",o:"opacity",p:"padding",pb:"paddingBottom",pl:"paddingLeft",pr:"paddingRight",pt:"paddingTop",r:"right",t:"top",ta:"textAlign",td:"textDecoration",tt:"textTransform",w:"width"},y=Object.create(null),m=window.getComputedStyle(document.documentElement,null),g=Array.prototype.slice.call(m,0,m.length).map(n),b=Object.create(null,{}),v=/^(o|O|ms|MS|Ms|moz|Moz|webkit|Webkit|WebKit)([A-Z])/,j=function(t,e){return void 0===e&&(e={}),function(n){return n in e?e[n]:e[n]=t(n)}}(function(t){var e=document.createElement("div");try{return e.style[t]="1px",e.style.setProperty(t,"1px"),"1px"===e.style[t].slice(-3)?"px":""}catch(t){return""}},{flex:""}),A=window.document,k=Object.create(null,{}),w=A&&A.createElement("style");w&&A.head.appendChild(w);var O=w&&w.sheet,x=!1,$=[],C=0,S="b"+("000"+(46656*Math.random()|0).toString(36)).slice(-3)+("000"+(46656*Math.random()|0).toString(36)).slice(-3),E=0,L={};return l.setDebug=function(t){x=t},l.style={},l.valueOf=function(){return"."+this.class},l.$keyframes=function(t){var e=Object.keys(t).map(function(e){return o(e,t[e].style||t[e])}).join("");if(e in L)return L[e];var n=S+ ++E;return L[e]=n,u("@keyframes "+n+"{"+e+"}"),n},l.getSheet=function(){var t=$.join("");return $=[],t},l.helper=h,l.css=p,l.classPrefix=S,g.forEach(function(t){if(v.test(t)){var e=function(t){return t.charAt(0).toLowerCase()+t.slice(1)}(t.replace(v,"$2"));if(-1===g.indexOf(e))return b[e]=t,void(l[e]=l[r(e)]=f(t))}l[t]=l[r(t)]=f(t)}),l.content=function(t){return this.style.content='"'+t+'"',s(this)},Object.defineProperty(l,"class",{get:function(){return function(t){var e=i(t),n=e.join("");if(n in k)return k[n];var r=S+ ++C;return e.map(function(t){return u(t.replace(/\.\$/,"."+r))}),k[n]=r,r}(this.style)}}),l.$media=function(e,n){return this.style["@media "+e]=t(n),s(this)},l.$nest=function(e,n){return this.style[(":"===e.charAt(0)?"":" ")+e]=t(n),s(this)},["active","any","checked","default","disabled","empty","enabled","first","first-child","first-of-type","fullscreen","focus","hover","indeterminate","in-range","invalid","last-child","last-of-type","left","link","only-child","only-of-type","optional","out-of-range","read-only","read-write","required","right","root","scope","target","valid","visited","dir","lang","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","after","before","first-letter","first-line","selection","backdrop","placeholder","marker","spelling-error","grammar-error"].forEach(function(e){return l["$"+n(e)]=function(n,r){return this.style[":"+e+(r?"("+n+")":"")]=t(r||n),s(this)}}),l.helper("$animate",function(t,e){return l.animation(l.$keyframes(e)+" "+t)}),l});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.b=e()}(this,function(){"use strict";function t(e){return e.hasOwnProperty("width")?e:t(Object.getPrototypeOf(e))}function e(t,e){var n;return"string"==typeof t?"string"==typeof e||"number"==typeof e?(n={},n[t]=e,n):u(t):Array.isArray(t)&&Array.isArray(t.raw)?(arguments[0]={raw:t},u(String.raw.apply(null,arguments))):t.style||function(t){return Object.keys(t).reduce(function(e,n){var r=t[n];return r||0===r||""===r?("content"===n&&'"'!==r.charAt(0)?e[n]='"'+r+'"':e[n in b?b[n]:n]=a(n,r),e):e},{})}(t)}function n(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}function r(t){return t.slice("-"===t.charAt(0)?1:0).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})}function i(t){var e=function(t){return t.charAt(0)+(t.match(/([A-Z])/g)||[]).join("").toLowerCase()}(t),n=y[e]&&y[e]!==t?t:e;return m[n]=t,n}function o(t){var e={},n=[],r=!1;return Object.keys(t).forEach(function(i){"@"===i.charAt(0)?n.push(i+"{"+o(t[i])+"}"):" "===i.charAt(0)||":"===i.charAt(0)?n.push(c(".$"+i,t[i])):(e[i]=t[i],r=!0)}),r&&n.unshift(c(".$",e)),n}function c(t,e){return t+"{"+function(t){return Object.keys(t).map(function(e){return function(t,e){return(v.test(e)?"-":"")+function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}(e)+":"+t[e]+";"}(t,e)}).join("")}("string"==typeof e?u(e):e)+"}"}function u(t){return t.replace(/;/g,"\n").split("\n").reduce(function(t,e){var n=e.trim().split(/[: ]/);if(n.length>1){var i=r(n.shift().trim());t[m[i]||i]=a(m[i]||i,n.join(" ").trim())}return t},{})}function a(t,e){return e+(isNaN(e)?"":j(t))}function s(t,e){if($.push(t),x)return A.textContent+=t;w&&w.insertRule(t,arguments.length>1?e:w.cssRules.length)}function f(t,r){return n(f.style,e.apply(null,arguments)),l(f)}function l(t){var e=Object.create(f,{style:{value:t.style}});return t===f&&(f.style={}),e}function h(t){return function(e){return e||0===e?arguments.length>0&&(this.style[t]=1===arguments.length?a(t,e):Array.prototype.slice.call(arguments).map(function(e){return a(t,e)}).join(" ")):delete this.style[t],l(this)}}function p(t,n){if(1===arguments.length)return Object.keys(t).forEach(function(e){return p(e,t[e])});s(c(t,e(n)),0)}function d(t,r){return 1===arguments.length?Object.keys(t).forEach(function(e){return d(e,t[e])}):"object"==typeof r?(delete f[t],void Object.defineProperty(f,t,{get:function(){return n(this.style,e(r)),l(this)}})):void(f[t]=function(){var t=r.apply(null,arguments);return n(this.style,t.style),l(this)})}var y={ai:"alignItems",b:"bottom",bc:"backgroundColor",br:"borderRadius",bs:"boxShadow",c:"color",d:"display",f:"float",fd:"flexDirection",ff:"fontFamily",fs:"fontSize",h:"height",jc:"justifyContent",l:"left",ls:"letterSpacing",m:"margin",mb:"marginBottom",ml:"marginLeft",mr:"marginRight",mt:"marginTop",o:"opacity",p:"padding",pb:"paddingBottom",pl:"paddingLeft",pr:"paddingRight",pt:"paddingTop",r:"right",t:"top",ta:"textAlign",td:"textDecoration",tt:"textTransform",w:"width"},m=Object.create(null),g=Object.keys(t(document.documentElement.style)).filter(function(t){return"string"==typeof document.documentElement.style[t]}),b=Object.create(null,{}),v=/^(o|O|ms|MS|Ms|moz|Moz|webkit|Webkit|WebKit)([A-Z])/,j=function(t,e){return void 0===e&&(e={}),function(n){return n in e?e[n]:e[n]=t(n)}}(function(t){var e=document.createElement("div");try{return e.style[t]="1px",e.style.setProperty(t,"1px"),"1px"===e.style[t].slice(-3)?"px":""}catch(t){return""}},{flex:""}),O=window.document,k=Object.create(null,{}),A=O&&O.createElement("style");A&&O.head.appendChild(A);var w=A&&A.sheet,x=!1,$=[],E=0,C="b"+("000"+(46656*Math.random()|0).toString(36)).slice(-3)+("000"+(46656*Math.random()|0).toString(36)).slice(-3),S=0,P={};return f.setDebug=function(t){x=t},f.style={},f.valueOf=function(){return"."+this.class},f.$keyframes=function(t){var e=Object.keys(t).map(function(e){return c(e,t[e].style||t[e])}).join("");if(e in P)return P[e];var n=C+ ++S;return P[e]=n,s("@keyframes "+n+"{"+e+"}"),n},f.getSheet=function(){var t=$.join("");return $=[],t},f.helper=d,f.css=p,f.classPrefix=C,g.forEach(function(t){if(v.test(t)){var e=function(t){return t.charAt(0).toLowerCase()+t.slice(1)}(t.replace(v,"$2"));if(-1===g.indexOf(e))return b[e]=t,void(f[e]=f[i(e)]=h(t))}f[t]=f[i(t)]=h(t)}),f.content=function(t){return this.style.content='"'+t+'"',l(this)},Object.defineProperty(f,"class",{get:function(){return function(t){var e=o(t),n=e.join("");if(n in k)return k[n];var r=C+ ++E;return e.map(function(t){return s(t.replace(/\.\$/,"."+r))}),k[n]=r,r}(this.style)}}),f.$media=function(t,n){return this.style["@media "+t]=e(n),l(this)},f.$nest=function(t,n){return this.style[(":"===t.charAt(0)?"":" ")+t]=e(n),l(this)},["active","any","checked","default","disabled","empty","enabled","first","first-child","first-of-type","fullscreen","focus","hover","indeterminate","in-range","invalid","last-child","last-of-type","left","link","only-child","only-of-type","optional","out-of-range","read-only","read-write","required","right","root","scope","target","valid","visited","dir","lang","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","after","before","first-letter","first-line","selection","backdrop","placeholder","marker","spelling-error","grammar-error"].forEach(function(t){return f["$"+r(t)]=function(n,r){return this.style[":"+t+(r?"("+n+")":"")]=e(r||n),l(this)}}),f.helper("$animate",function(t,e){return f.animation(f.$keyframes(e)+" "+t)}),f});
//# sourceMappingURL=bss.min.js.map

@@ -5,5 +5,11 @@ import popular from './popular'

const style = window.getComputedStyle(document.documentElement, null)
export const cssProperties = Object.keys(
findWidth(document.documentElement.style)
).filter(prop => typeof document.documentElement.style[prop] === 'string')
export const cssProperties = Array.prototype.slice.call(style, 0, style.length).map(hyphenToCamelCase)
function findWidth(obj) {
return obj.hasOwnProperty('width')
? obj
: findWidth(Object.getPrototypeOf(obj))
}

@@ -10,0 +16,0 @@ export const vendorMap = Object.create(null, {})

{
"name": "bss",
"version": "1.0.4",
"version": "1.0.5",
"description": "Better Style Sheets",

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

@@ -28,2 +28,10 @@ const o = require('ospec')

appendChild: () => null
},
documentElement: {
style: {
backgroundColor: '',
content: '',
width: '0',
padding: ''
}
}

@@ -33,3 +41,2 @@ }

global.window = {
getComputedStyle: () => (['width', 'backgroundColor', 'padding']),
navigator: {

@@ -36,0 +43,0 @@ userAgent: 'test'

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc