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

fela

Package Overview
Dependencies
Maintainers
1
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fela - npm Package Compare versions

Comparing version 4.1.1 to 4.1.2

10

dist/fela.js

@@ -200,3 +200,4 @@ (function (global, factory) {

/* weak */
var chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var chars = 'abcdefghijklmnopqrstuvwxyz';
var charLength = chars.length;

@@ -206,3 +207,3 @@ function generateClassName(id) {

if (id <= 52) {
if (id <= charLength) {
return chars[id - 1] + className;

@@ -212,3 +213,3 @@ }

// Bitwise floor as safari performs much faster https://jsperf.com/math-floor-vs-math-round-vs-parseint/55
return generateClassName(id / 52 | 0, chars[id % 52] + className);
return generateClassName(id / charLength | 0, chars[id % charLength] + className);
}

@@ -350,2 +351,3 @@

mediaQueryOrder: config.mediaQueryOrder || [],
selectorPrefix: config.selectorPrefix || '',

@@ -403,3 +405,3 @@ clear: function clear() {

var className = generateClassName(++renderer.uniqueRuleIdentifier);
var className = renderer.selectorPrefix + generateClassName(++renderer.uniqueRuleIdentifier);

@@ -406,0 +408,0 @@ renderer.cache[declarationReference] = className;

2

dist/fela.min.js

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

!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):e.Fela=r()}(this,function(){"use strict";function e(e,r){return r={exports:{}},e(r,r.exports),r.exports}function r(e,r){return N(e)+":"+r}function n(e){var n="";for(var t in e)n&&(n+=";"),n+=r(t,e[t]);return n}function t(e){return"@font-face{"+n(e)+"}"}function o(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],o=Object.keys(e).reduce(function(r,t){return r+t+"{"+n(e[t])+"}"},"");return t.reduce(function(e,n){return e+"@"+n+"keyframes "+r+"{"+o+"}"},"")}function i(e,r){return"@media "+e+"{"+r+"}"}function a(e){return"k"+e}function u(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e<=52?I[e-1]+r:u(e/52|0,I[e%52]+r)}function f(e,r){return 0===e.length?r:e+" and "+r}function c(e,r){return e+"{"+r+"}"}function s(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"."+e+r}function l(e){return e.replace(/\s{2,}/g,"")}function d(e,r,n){for(var t=0;t<r.length;++t)e=r[t](e,n);return e}function y(e,r){if("string"==typeof e)return l(e);var t=d(e,r,K);return n(t)}function p(e,r){return"string"==typeof e?e:r+JSON.stringify(e)}function h(e){return"["===e.charAt(0)}function m(e){return":"===e.charAt(0)}function v(e){return">"===e.charAt(0)}function g(e){return"@media"===e.substr(0,6)}function b(e){return void 0===e||"string"==typeof e&&e.indexOf("undefined")>-1}function O(e){for(var r={},n=0,t=e.length;n<t;++n)r[e[n]]="";return r}function C(e){return'"'===e.charAt(0)?e:'"'+e+'"'}function x(e){for(var r=0,n=L.length;r<n;++r){var t=L[r];if(e.indexOf(t)!==-1)return z[t]}}function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={listeners:[],keyframePrefixes:e.keyframePrefixes||["-webkit-","-moz-"],plugins:e.plugins||[],mediaQueryOrder:e.mediaQueryOrder||[],clear:function(){n.fontFaces="",n.keyframes="",n.statics="",n.rules="",n.mediaRules=O(n.mediaQueryOrder),n.rendered=[],n.uniqueRuleIdentifier=0,n.uniqueKeyframeIdentifier=0,n.cache={},n._emitChange({type:Q})},renderRule:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=d(e(r),n.plugins,q);return n._renderStyleToClassNames(t).slice(1)},_renderStyleToClassNames:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i="";for(var a in e){var l=e[a];if(l instanceof Object){if(m(a)||h(a)||v(a))i+=n._renderStyleToClassNames(l,t+a,o);else if(g(a)){var d=f(o,a.slice(6).trim());i+=n._renderStyleToClassNames(l,t,d)}}else{var y=o+t+a+l;if(!n.cache[y]){if(b(l)){n.cache[y]="";continue}var p=u(++n.uniqueRuleIdentifier);n.cache[y]=p;var O=r(a,l),C=s(p,t),x=c(C,O);o?(n.mediaRules.hasOwnProperty(o)||(n.mediaRules[o]=""),n.mediaRules[o]+=x):n.rules+=x,n._emitChange({selector:C,declaration:O,media:o,type:q})}i+=" "+n.cache[y]}}return i},renderKeyframe:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e(r),i=JSON.stringify(t);if(!n.cache[i]){var u=a(++n.uniqueKeyframeIdentifier),f=d(t,n.plugins,E),c=o(f,u,n.keyframePrefixes);n.cache[i]=u,n.keyframes+=c,n._emitChange({name:u,keyframe:c,type:E})}return n.cache[i]},renderFont:function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=e+JSON.stringify(o);if(!n.cache[i]){var a=C(e),u=T.extends({},o,{src:r.map(function(e){return"url('"+e+"') format('"+x(e)+"')"}).join(","),fontFamily:a}),f=t(u);n.cache[i]=a,n.fontFaces+=f,n._emitChange({fontFamily:a,fontFace:f,type:J})}return n.cache[i]},renderStatic:function(e,r){var t=p(e,r);if(!n.cache[t]){var o=y(e,n.plugins);n.cache[t]=!0,"string"==typeof e?(n.statics+=o,n._emitChange({type:K,css:o})):(n.statics+=c(r,o),n._emitChange({selector:r,declaration:o,type:q,media:""}))}},renderToString:function(){var e=n.fontFaces+n.statics+n.keyframes+n.rules;for(var r in n.mediaRules)e+=i(r,n.mediaRules[r]);return e},subscribe:function(e){return n.listeners.push(e),{unsubscribe:function(){return n.listeners.splice(n.listeners.indexOf(e),1)}}},_emitChange:function(e){for(var r=0,t=n.listeners.length;r<t;++r)n.listeners[r](e)}};if(n.keyframePrefixes.push(""),n.clear(),e.enhancers)for(var l=0,w=e.enhancers.length;l<w;++l)n=e.enhancers[l](n);return n}function j(e){for(var r=arguments.length,n=Array(r>1?r-1:0),t=1;t<r;t++)n[t-1]=arguments[t];for(var o=0,i=n.length;o<i;++o){var a=n[o];for(var u in a){var f=a[u];e[u]instanceof Object&&f instanceof Object?e[u]=j({},e[u],f):e[u]=f}}return e}function S(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(e){for(var n={},t=0,o=r.length;t<o;++t)j(n,r[t](e));return n}}function k(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(e){return function(n){for(var t=e(n),o=0,i=r.length;o<i;++o)t=r[o](t);return t}}}function R(e,r){return function(n){n.type!==q||n.media?r.textContent=e.renderToString():r.sheet.insertRule(n.selector+"{"+n.declaration+"}",r.sheet.cssRules.length)}}function A(e){return e&&1===e.nodeType}function _(e,r){if(!A(r))throw new Error("You need to specify a valid element node (nodeType = 1) to render into.");r.setAttribute("data-fela-stylesheet","");var n=R(e,r);e.subscribe(n);var t=e.renderToString();r.textContent!==t&&(r.textContent=t)}function P(e,r){return console.warn("Importing `render` from `fela` is deprecated. Use `fela-dom` to import `render` instead."),_(e,r)}var T={};T.typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T.classCallCheck=function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},T.createClass=function(){function e(e,r){for(var n=0;n<r.length;n++){var t=r[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}return function(r,n,t){return n&&e(r.prototype,n),t&&e(r,t),r}}(),T.defineProperty=function(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e},T.extends=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},T.inherits=function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function, not "+typeof r);e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r)},T.objectWithoutProperties=function(e,r){var n={};for(var t in e)r.indexOf(t)>=0||Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n},T.possibleConstructorReturn=function(e,r){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!r||"object"!=typeof r&&"function"!=typeof r?e:r},T.toConsumableArray=function(e){if(Array.isArray(e)){for(var r=0,n=Array(e.length);r<e.length;r++)n[r]=e[r];return n}return Array.from(e)};var F=e(function(e){function r(e){return e in o?o[e]:o[e]=e.replace(n,"-$&").toLowerCase().replace(t,"-ms-")}var n=/[A-Z]/g,t=/^ms-/,o={};e.exports=r}),N=F&&"object"==typeof F&&"default"in F?F.default:F,I="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",q=1,E=2,J=3,K=4,Q=5,z={".woff":"woff",".eot":"eot",".ttf":"truetype",".svg":"svg"},L=Object.keys(z),U={createRenderer:w,combineRules:S,enhance:k,render:P};return U});
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):e.Fela=r()}(this,function(){"use strict";function e(e,r){return r={exports:{}},e(r,r.exports),r.exports}function r(e,r){return N(e)+":"+r}function n(e){var n="";for(var t in e)n&&(n+=";"),n+=r(t,e[t]);return n}function t(e){return"@font-face{"+n(e)+"}"}function o(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],o=Object.keys(e).reduce(function(r,t){return r+t+"{"+n(e[t])+"}"},"");return t.reduce(function(e,n){return e+"@"+n+"keyframes "+r+"{"+o+"}"},"")}function i(e,r){return"@media "+e+"{"+r+"}"}function a(e){return"k"+e}function u(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e<=I?q[e-1]+r:u(e/I|0,q[e%I]+r)}function f(e,r){return 0===e.length?r:e+" and "+r}function c(e,r){return e+"{"+r+"}"}function s(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"."+e+r}function l(e){return e.replace(/\s{2,}/g,"")}function d(e,r,n){for(var t=0;t<r.length;++t)e=r[t](e,n);return e}function y(e,r){if("string"==typeof e)return l(e);var t=d(e,r,Q);return n(t)}function p(e,r){return"string"==typeof e?e:r+JSON.stringify(e)}function h(e){return"["===e.charAt(0)}function m(e){return":"===e.charAt(0)}function v(e){return">"===e.charAt(0)}function g(e){return"@media"===e.substr(0,6)}function b(e){return void 0===e||"string"==typeof e&&e.indexOf("undefined")>-1}function O(e){for(var r={},n=0,t=e.length;n<t;++n)r[e[n]]="";return r}function x(e){return'"'===e.charAt(0)?e:'"'+e+'"'}function C(e){for(var r=0,n=U.length;r<n;++r){var t=U[r];if(e.indexOf(t)!==-1)return L[t]}}function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={listeners:[],keyframePrefixes:e.keyframePrefixes||["-webkit-","-moz-"],plugins:e.plugins||[],mediaQueryOrder:e.mediaQueryOrder||[],selectorPrefix:e.selectorPrefix||"",clear:function(){n.fontFaces="",n.keyframes="",n.statics="",n.rules="",n.mediaRules=O(n.mediaQueryOrder),n.rendered=[],n.uniqueRuleIdentifier=0,n.uniqueKeyframeIdentifier=0,n.cache={},n._emitChange({type:z})},renderRule:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=d(e(r),n.plugins,E);return n._renderStyleToClassNames(t).slice(1)},_renderStyleToClassNames:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i="";for(var a in e){var l=e[a];if(l instanceof Object){if(m(a)||h(a)||v(a))i+=n._renderStyleToClassNames(l,t+a,o);else if(g(a)){var d=f(o,a.slice(6).trim());i+=n._renderStyleToClassNames(l,t,d)}}else{var y=o+t+a+l;if(!n.cache[y]){if(b(l)){n.cache[y]="";continue}var p=n.selectorPrefix+u(++n.uniqueRuleIdentifier);n.cache[y]=p;var O=r(a,l),x=s(p,t),C=c(x,O);o?(n.mediaRules.hasOwnProperty(o)||(n.mediaRules[o]=""),n.mediaRules[o]+=C):n.rules+=C,n._emitChange({selector:x,declaration:O,media:o,type:E})}i+=" "+n.cache[y]}}return i},renderKeyframe:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e(r),i=JSON.stringify(t);if(!n.cache[i]){var u=a(++n.uniqueKeyframeIdentifier),f=d(t,n.plugins,J),c=o(f,u,n.keyframePrefixes);n.cache[i]=u,n.keyframes+=c,n._emitChange({name:u,keyframe:c,type:J})}return n.cache[i]},renderFont:function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=e+JSON.stringify(o);if(!n.cache[i]){var a=x(e),u=T.extends({},o,{src:r.map(function(e){return"url('"+e+"') format('"+C(e)+"')"}).join(","),fontFamily:a}),f=t(u);n.cache[i]=a,n.fontFaces+=f,n._emitChange({fontFamily:a,fontFace:f,type:K})}return n.cache[i]},renderStatic:function(e,r){var t=p(e,r);if(!n.cache[t]){var o=y(e,n.plugins);n.cache[t]=!0,"string"==typeof e?(n.statics+=o,n._emitChange({type:Q,css:o})):(n.statics+=c(r,o),n._emitChange({selector:r,declaration:o,type:E,media:""}))}},renderToString:function(){var e=n.fontFaces+n.statics+n.keyframes+n.rules;for(var r in n.mediaRules)e+=i(r,n.mediaRules[r]);return e},subscribe:function(e){return n.listeners.push(e),{unsubscribe:function(){return n.listeners.splice(n.listeners.indexOf(e),1)}}},_emitChange:function(e){for(var r=0,t=n.listeners.length;r<t;++r)n.listeners[r](e)}};if(n.keyframePrefixes.push(""),n.clear(),e.enhancers)for(var l=0,w=e.enhancers.length;l<w;++l)n=e.enhancers[l](n);return n}function j(e){for(var r=arguments.length,n=Array(r>1?r-1:0),t=1;t<r;t++)n[t-1]=arguments[t];for(var o=0,i=n.length;o<i;++o){var a=n[o];for(var u in a){var f=a[u];e[u]instanceof Object&&f instanceof Object?e[u]=j({},e[u],f):e[u]=f}}return e}function S(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(e){for(var n={},t=0,o=r.length;t<o;++t)j(n,r[t](e));return n}}function k(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(e){return function(n){for(var t=e(n),o=0,i=r.length;o<i;++o)t=r[o](t);return t}}}function P(e,r){return function(n){n.type!==E||n.media?r.textContent=e.renderToString():r.sheet.insertRule(n.selector+"{"+n.declaration+"}",r.sheet.cssRules.length)}}function R(e){return e&&1===e.nodeType}function _(e,r){if(!R(r))throw new Error("You need to specify a valid element node (nodeType = 1) to render into.");r.setAttribute("data-fela-stylesheet","");var n=P(e,r);e.subscribe(n);var t=e.renderToString();r.textContent!==t&&(r.textContent=t)}function A(e,r){return console.warn("Importing `render` from `fela` is deprecated. Use `fela-dom` to import `render` instead."),_(e,r)}var T={};T.typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T.classCallCheck=function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},T.createClass=function(){function e(e,r){for(var n=0;n<r.length;n++){var t=r[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}return function(r,n,t){return n&&e(r.prototype,n),t&&e(r,t),r}}(),T.defineProperty=function(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e},T.extends=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},T.inherits=function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function, not "+typeof r);e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r)},T.objectWithoutProperties=function(e,r){var n={};for(var t in e)r.indexOf(t)>=0||Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n},T.possibleConstructorReturn=function(e,r){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!r||"object"!=typeof r&&"function"!=typeof r?e:r},T.toConsumableArray=function(e){if(Array.isArray(e)){for(var r=0,n=Array(e.length);r<e.length;r++)n[r]=e[r];return n}return Array.from(e)};var F=e(function(e){function r(e){return e in o?o[e]:o[e]=e.replace(n,"-$&").toLowerCase().replace(t,"-ms-")}var n=/[A-Z]/g,t=/^ms-/,o={};e.exports=r}),N=F&&"object"==typeof F&&"default"in F?F.default:F,q="abcdefghijklmnopqrstuvwxyz",I=q.length,E=1,J=2,K=3,Q=4,z=5,L={".woff":"woff",".eot":"eot",".ttf":"truetype",".svg":"svg"},U=Object.keys(L),W={createRenderer:w,combineRules:S,enhance:k,render:A};return W});

@@ -107,2 +107,3 @@ 'use strict';

mediaQueryOrder: config.mediaQueryOrder || [],
selectorPrefix: config.selectorPrefix || '',

@@ -160,3 +161,3 @@ clear: function clear() {

var className = (0, _generateClassName2.default)(++renderer.uniqueRuleIdentifier);
var className = renderer.selectorPrefix + (0, _generateClassName2.default)(++renderer.uniqueRuleIdentifier);

@@ -163,0 +164,0 @@ renderer.cache[declarationReference] = className;

@@ -8,3 +8,4 @@ 'use strict';

/* weak */
var chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var chars = 'abcdefghijklmnopqrstuvwxyz';
var charLength = chars.length;

@@ -14,3 +15,3 @@ function generateClassName(id) {

if (id <= 52) {
if (id <= charLength) {
return chars[id - 1] + className;

@@ -20,4 +21,4 @@ }

// Bitwise floor as safari performs much faster https://jsperf.com/math-floor-vs-math-round-vs-parseint/55
return generateClassName(id / 52 | 0, chars[id % 52] + className);
return generateClassName(id / charLength | 0, chars[id % charLength] + className);
}
module.exports = exports['default'];
{
"name": "fela",
"version": "4.1.1",
"version": "4.1.2",
"description": "Fast & Dynamic Styling in JavaScript",

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

Sorry, the diff of this file is not supported yet

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