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.2.7 to 1.2.8

17

bss.js

@@ -414,3 +414,9 @@ (function (global, factory) {

function addNest(style, selector, properties) {
selector.split(selectorSplit).map(function (x) { return x.trim(); }).forEach(function (x) { return add(style, (x.charAt(0) === ':' || x.charAt(0) === '[' ? '' : ' ') + x, parse(properties)); }
add(
style,
selector.split(selectorSplit).map(function (x) {
x = x.trim();
return (x.charAt(0) === ':' || x.charAt(0) === '[' ? '' : ' ') + x
}).join(',.$'),
parse(properties)
);

@@ -552,2 +558,3 @@ }

function parse(input, value) {
var arguments$1 = arguments;
var obj;

@@ -560,5 +567,7 @@

return stringToObject(input)
} else if (Array.isArray(input) && Array.isArray(input.raw)) {
arguments[0] = { raw: input };
return stringToObject(String.raw.apply(null, arguments))
} else if (Array.isArray(input) && typeof input[0] === 'string') {
var str = '';
for (var i = 0; i < input.length; i++)
{ str += input[i] + (arguments$1[i + 1] || ''); }
return stringToObject(str)
}

@@ -565,0 +574,0 @@

@@ -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";var i={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",lh:"lineHeight",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"},a=["float"].concat(Object.keys(function t(e){return e.hasOwnProperty("width")?e:t(Object.getPrototypeOf(e))}(document.documentElement.style)).filter(function(t){return-1===t.indexOf("-")&&"length"!==t}));var t=function(e,n){return void 0===n&&(n={}),function(t){return t in n?n[t]:n[t]=e(t)}};function f(t,e,n){if(!(e in t))return t[e]=n;t._fallback||Object.defineProperty(t,"_fallback",{configurable:!0,value:Object.create(null,{})}),f(t._fallback,e,n)}var c=Object.create(null,{}),o=Object.create(null,{}),l=/^(o|O|ms|MS|Ms|moz|Moz|webkit|Webkit|WebKit)([A-Z])/,n=t(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:"",boxShadow:"px",border:"px"});function u(t,e){for(var n in e._fallback&&(t._fallback?u(t._fallback,e._fallback):Object.defineProperty(t,"_fallback",{value:e._fallback})),e)e.hasOwnProperty(n)&&(t[n]=e[n])}function s(t){return t.slice("-"===t.charAt(0)?1:0).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})}function h(e,n){void 0===n&&(n="");var r={},i=[];return e._fallback&&Object.defineProperty(r,"_fallback",{configurable:!0,value:e._fallback}),Object.keys(e).forEach(function(t){"@"===t.charAt(0)?i.push(t+"{"+h(e[t])+"}"):"object"==typeof e[t]?i=i.concat(h(e[t],n+t)):r[t]=e[t]}),Object.keys(r).length&&i.unshift((" "===n.charAt(0)?"":".$")+".$"+n+"{"+p(r)+"}"),i}var r=/,(?=(?:(?:[^"]*"){2})*[^"]*$)/;function p(i){return Object.keys(i).reduce(function(t,e){return t+(r=i[n=e],(l.test(n)?"-":"")+("-"===n.charAt(0)&&"-"===n.charAt(1)?n:n.replace(/([A-Z])/g,"-$1").toLowerCase())+":"+r+";");var n,r},"")+(i._fallback?p(i._fallback):"")}function d(t,e){return e in o?o[e]:y(t,e)}function y(t,e){return e+(isNaN(e)?"":n(t))}var e=window.document,b=e&&e.createElement("style");b&&e.head.appendChild(b);var g=b&&b.sheet,m=!1,v=Object.create(null,{}),j=[],k=0,O="b"+("000"+(46656*Math.random()|0).toString(36)).slice(-3)+("000"+(46656*Math.random()|0).toString(36)).slice(-3);function A(t,e){if(j.push(t),m)return b.textContent=j.join("\n");g&&g.insertRule(t,1<arguments.length?e:g.cssRules.length)}var x=Object.create(null);function w(t,e){var n=$(w);return u(n.style,D.apply(null,arguments)),n}function _(t,e){Object.defineProperty(w,t,{configurable:!0,value:e})}function $(t){var e=Object.create(w,{style:{value:t.style,enumerable:!0}});return t===w&&(w.style={}),e}function P(e,t,n){t.split(r).map(function(t){return t.trim()}).forEach(function(t){return f(e,(":"===t.charAt(0)||"["===t.charAt(0)?"":" ")+t,D(n))})}function E(e){return function(t){return t||0===t?0<arguments.length&&f(this.style,e,1===arguments.length?d(e,t):Array.prototype.slice.call(arguments).map(function(t){return y(e,t)}).join(" ")):delete this.style[e],$(this)}}function S(e,t){h(D(t)).forEach(function(t){return A(t.replace(/\.\$\.?\$?/g,e))})}function C(e,n){if(1===arguments.length)return Object.keys(e).forEach(function(t){return C(t,e[t])});delete w[e],"function"==typeof n?(C[e]=n,Object.defineProperty(w,e,{configurable:!0,value:function(){var t=n.apply(null,arguments);return u(this.style,t.style),$(this)}})):(C[e]=D(n),Object.defineProperty(w,e,{configurable:!0,get:function(){return u(this.style,D(n)),$(this)}}))}function L(t){var e,n=(e=t).charAt(0)+(e.match(/([A-Z])/g)||[]).join("").toLowerCase(),r=i[n]&&i[n]!==t?t:n;return x[r]=t,r}Object.defineProperty(w,"valueOf",{configurable:!0,writable:!0,value:function(){return"."+this.class}}),w.style={},_("setDebug",function(t){m=t}),_("$keyframes",function(n){var t=Object.keys(n).reduce(function(t,e){return t+e+"{"+p(D(n[e]))+"}"},"");if(t in z)return z[t];var e=O+R++;return A("@keyframes "+(z[t]=e)+"{"+t+"}"),e}),_("$media",function(t,e){t&&f(this.style,"@media "+t,D(e));return $(this)}),_("$import",function(t){t&&A("@import "+t+";",0);return $(this)}),_("$nest",function(e,t){var n=this;1===arguments.length?Object.keys(e).forEach(function(t){return P(n.style,t,e[t])}):e&&P(this.style,e,t);return $(this)}),_("getSheet",function(){var t=j.join("");return j=[],v=Object.create(null,{}),k=0,t}),_("helper",C),_("css",function(e,t){1===arguments.length?Object.keys(e).forEach(function(t){return S(t,e[t])}):S(e,t);return $(this)}),_("classPrefix",O),a.forEach(function(t){var e,n=t.match(l);if(n){var r=(e=t.replace(l,"$2")).charAt(0).toLowerCase()+e.slice(1);if(-1===a.indexOf(r))return"flexDirection"===r&&(o.flex="-"+n[1].toLowerCase()+"-flex"),_(r,E(c[r]=t)),void _(L(r),w[r])}_(t,E(t)),_(L(t),w[t])}),_("content",function(t){return this.style.content='"'+t+'"',$(this)}),Object.defineProperty(w,"class",{set:function(t){this.__class=t},get:function(){return this.__class||function(t){var e=JSON.stringify(t);if(e in v)return v[e];for(var n=h(t),r=O+ ++k,i=0;i<n.length;i++)A(n[i].replace(/\.\$/g,"."+r));return v[e]=r}(this.style)}}),[":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(n){return _("$"+s(n.replace(/:/g,"")),function(t,e){return(t||e)&&f(this.style,n+(e?"("+t+")":""),D(e||t)),$(this)})}),w.helper("$animate",function(t,e){return w.animation(w.$keyframes(e)+" "+t)});var M=t(function(t){var o,l="";return t.trim().split(/;|\n/).reduce(function(t,e){if(e=l+e.trim(),l=","===e.charAt(e.length-1)?e:"")return t;if(","===e.charAt(0))return t[o]+=e,t;var n=e.replace(/[ :]+/," ").split(" "),r=n[0],i=n.slice(1);if(!r)return t;var a="-"===r.charAt(0)&&"-"===r.charAt(1),c=a?r:s(r);return o=x[c]||c,c in C?u(t,"function"==typeof C[c]?C[c].apply(C,i).style:C[c]):0<i.length&&f(t,o,i.map(function(t){return a?t:y(o,t)}).join(" ")),t},{})}),R=0,z={};function D(t,e){var n,r;return"string"==typeof t?"string"==typeof e||"number"==typeof e?((n={})[t]=e,n):M(t):Array.isArray(t)&&Array.isArray(t.raw)?(t={raw:t},M(String.raw.apply(null,arguments))):t.style||(r=t,Object.keys(r).reduce(function(t,e){var n=r[e];return(n||0===n||""===n)&&("content"===e&&'"'!==n.charAt(0)?t[e]='"'+n+'"':t[e in c?c[e]:e]=d(e,n)),t},{}))}return w});
!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";var i={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",lh:"lineHeight",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"},a=["float"].concat(Object.keys(function t(e){return e.hasOwnProperty("width")?e:t(Object.getPrototypeOf(e))}(document.documentElement.style)).filter(function(t){return-1===t.indexOf("-")&&"length"!==t}));var t=function(e,n){return void 0===n&&(n={}),function(t){return t in n?n[t]:n[t]=e(t)}};function f(t,e,n){if(!(e in t))return t[e]=n;t._fallback||Object.defineProperty(t,"_fallback",{configurable:!0,value:Object.create(null,{})}),f(t._fallback,e,n)}var o=Object.create(null,{}),c=Object.create(null,{}),l=/^(o|O|ms|MS|Ms|moz|Moz|webkit|Webkit|WebKit)([A-Z])/,n=t(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:"",boxShadow:"px",border:"px"});function u(t,e){for(var n in e._fallback&&(t._fallback?u(t._fallback,e._fallback):Object.defineProperty(t,"_fallback",{value:e._fallback})),e)e.hasOwnProperty(n)&&(t[n]=e[n])}function s(t){return t.slice("-"===t.charAt(0)?1:0).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})}function h(e,n){void 0===n&&(n="");var r={},i=[];return e._fallback&&Object.defineProperty(r,"_fallback",{configurable:!0,value:e._fallback}),Object.keys(e).forEach(function(t){"@"===t.charAt(0)?i.push(t+"{"+h(e[t])+"}"):"object"==typeof e[t]?i=i.concat(h(e[t],n+t)):r[t]=e[t]}),Object.keys(r).length&&i.unshift((" "===n.charAt(0)?"":".$")+".$"+n+"{"+p(r)+"}"),i}var r=/,(?=(?:(?:[^"]*"){2})*[^"]*$)/;function p(i){return Object.keys(i).reduce(function(t,e){return t+(r=i[n=e],(l.test(n)?"-":"")+("-"===n.charAt(0)&&"-"===n.charAt(1)?n:n.replace(/([A-Z])/g,"-$1").toLowerCase())+":"+r+";");var n,r},"")+(i._fallback?p(i._fallback):"")}function d(t,e){return e in c?c[e]:y(t,e)}function y(t,e){return e+(isNaN(e)?"":n(t))}var e=window.document,b=e&&e.createElement("style");b&&e.head.appendChild(b);var g=b&&b.sheet,m=!1,v=Object.create(null,{}),j=[],k=0,O="b"+("000"+(46656*Math.random()|0).toString(36)).slice(-3)+("000"+(46656*Math.random()|0).toString(36)).slice(-3);function x(t,e){if(j.push(t),m)return b.textContent=j.join("\n");g&&g.insertRule(t,1<arguments.length?e:g.cssRules.length)}var A=Object.create(null);function _(t,e){var n=$(_);return u(n.style,D.apply(null,arguments)),n}function w(t,e){Object.defineProperty(_,t,{configurable:!0,value:e})}function $(t){var e=Object.create(_,{style:{value:t.style,enumerable:!0}});return t===_&&(_.style={}),e}function P(t,e,n){f(t,e.split(r).map(function(t){return(":"===(t=t.trim()).charAt(0)||"["===t.charAt(0)?"":" ")+t}).join(",.$"),D(n))}function E(e){return function(t){return t||0===t?0<arguments.length&&f(this.style,e,1===arguments.length?d(e,t):Array.prototype.slice.call(arguments).map(function(t){return y(e,t)}).join(" ")):delete this.style[e],$(this)}}function C(e,t){h(D(t)).forEach(function(t){return x(t.replace(/\.\$\.?\$?/g,e))})}function S(e,n){if(1===arguments.length)return Object.keys(e).forEach(function(t){return S(t,e[t])});delete _[e],"function"==typeof n?(S[e]=n,Object.defineProperty(_,e,{configurable:!0,value:function(){var t=n.apply(null,arguments);return u(this.style,t.style),$(this)}})):(S[e]=D(n),Object.defineProperty(_,e,{configurable:!0,get:function(){return u(this.style,D(n)),$(this)}}))}function L(t){var e,n=(e=t).charAt(0)+(e.match(/([A-Z])/g)||[]).join("").toLowerCase(),r=i[n]&&i[n]!==t?t:n;return A[r]=t,r}Object.defineProperty(_,"valueOf",{configurable:!0,writable:!0,value:function(){return"."+this.class}}),_.style={},w("setDebug",function(t){m=t}),w("$keyframes",function(n){var t=Object.keys(n).reduce(function(t,e){return t+e+"{"+p(D(n[e]))+"}"},"");if(t in z)return z[t];var e=O+R++;return x("@keyframes "+(z[t]=e)+"{"+t+"}"),e}),w("$media",function(t,e){t&&f(this.style,"@media "+t,D(e));return $(this)}),w("$import",function(t){t&&x("@import "+t+";",0);return $(this)}),w("$nest",function(e,t){var n=this;1===arguments.length?Object.keys(e).forEach(function(t){return P(n.style,t,e[t])}):e&&P(this.style,e,t);return $(this)}),w("getSheet",function(){var t=j.join("");return j=[],v=Object.create(null,{}),k=0,t}),w("helper",S),w("css",function(e,t){1===arguments.length?Object.keys(e).forEach(function(t){return C(t,e[t])}):C(e,t);return $(this)}),w("classPrefix",O),a.forEach(function(t){var e,n=t.match(l);if(n){var r=(e=t.replace(l,"$2")).charAt(0).toLowerCase()+e.slice(1);if(-1===a.indexOf(r))return"flexDirection"===r&&(c.flex="-"+n[1].toLowerCase()+"-flex"),w(r,E(o[r]=t)),void w(L(r),_[r])}w(t,E(t)),w(L(t),_[t])}),w("content",function(t){return this.style.content='"'+t+'"',$(this)}),Object.defineProperty(_,"class",{set:function(t){this.__class=t},get:function(){return this.__class||function(t){var e=JSON.stringify(t);if(e in v)return v[e];for(var n=h(t),r=O+ ++k,i=0;i<n.length;i++)x(n[i].replace(/\.\$/g,"."+r));return v[e]=r}(this.style)}}),[":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(n){return w("$"+s(n.replace(/:/g,"")),function(t,e){return(t||e)&&f(this.style,n+(e?"("+t+")":""),D(e||t)),$(this)})}),_.helper("$animate",function(t,e){return _.animation(_.$keyframes(e)+" "+t)});var M=t(function(t){var o,l="";return t.trim().split(/;|\n/).reduce(function(t,e){if(e=l+e.trim(),l=","===e.charAt(e.length-1)?e:"")return t;if(","===e.charAt(0))return t[o]+=e,t;var n=e.replace(/[ :]+/," ").split(" "),r=n[0],i=n.slice(1);if(!r)return t;var a="-"===r.charAt(0)&&"-"===r.charAt(1),c=a?r:s(r);return o=A[c]||c,c in S?u(t,"function"==typeof S[c]?S[c].apply(S,i).style:S[c]):0<i.length&&f(t,o,i.map(function(t){return a?t:y(o,t)}).join(" ")),t},{})}),R=0,z={};function D(t,e){var n,r,i=arguments;if("string"==typeof t)return"string"==typeof e||"number"==typeof e?((n={})[t]=e,n):M(t);if(Array.isArray(t)&&"string"==typeof t[0]){for(var a="",c=0;c<t.length;c++)a+=t[c]+(i[c+1]||"");return M(a)}return t.style||(r=t,Object.keys(r).reduce(function(t,e){var n=r[e];return(n||0===n||""===n)&&("content"===e&&'"'!==n.charAt(0)?t[e]='"'+n+'"':t[e in o?o[e]:e]=d(e,n)),t},{}))}return _});
//# sourceMappingURL=bss.min.js.map
## [Unreleased]
## 1.2.8 -
Remove String.raw requirement
Group multiple selectors in $nest
## 1.2.7 -

@@ -4,0 +8,0 @@ Fix attribute selector usage in `$nest`

@@ -139,4 +139,9 @@ /* eslint no-invalid-this: 0 */

function addNest(style, selector, properties) {
selector.split(selectorSplit).map(x => x.trim()).forEach(x =>
add(style, (x.charAt(0) === ':' || x.charAt(0) === '[' ? '' : ' ') + x, parse(properties))
add(
style,
selector.split(selectorSplit).map(x => {
x = x.trim()
return (x.charAt(0) === ':' || x.charAt(0) === '[' ? '' : ' ') + x
}).join(',.$'),
parse(properties)
)

@@ -284,5 +289,7 @@ }

return stringToObject(input)
} else if (Array.isArray(input) && Array.isArray(input.raw)) {
arguments[0] = { raw: input }
return stringToObject(String.raw.apply(null, arguments))
} else if (Array.isArray(input) && typeof input[0] === 'string') {
let str = ''
for (let i = 0; i < input.length; i++)
str += input[i] + (arguments[i + 1] || '')
return stringToObject(str)
}

@@ -289,0 +296,0 @@

{
"name": "bss",
"version": "1.2.7",
"version": "1.2.8",
"description": "Better Style Sheets",

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

@@ -124,3 +124,3 @@ const o = require('ospec')

const cls = b.$nest('th, tr', b('background blue')).class
o(b.getSheet()).equals(`.${cls} th{background:blue;}.${cls} tr{background:blue;}`)
o(b.getSheet()).equals(`.${cls} th,.${cls} tr{background:blue;}`)
})

@@ -127,0 +127,0 @@

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