Socket
Socket
Sign inDemoInstall

jss-camel-case

Package Overview
Dependencies
6
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.0.1

changelog.md

18

dist/jss-camel-case.js

@@ -74,15 +74,21 @@ (function webpackUniversalModuleDefinition(root, factory) {

/**
* Convert camel cased properties of a single style to dasherized.
* Convert camel cased property names to dash separated.
*
* @param {Object} style
* @return {Object} convertedStyle
* @return {Object}
*/
function convertCase(style) {
var convertedStyle = {};
var converted = {};
for (var prop in style) {
var value = style[prop];
prop = prop.replace(regExp, replace);
convertedStyle[prop] = value;
converted[prop] = value;
}
return convertedStyle;
if (style.fallbacks) {
if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);
}
return converted;
}

@@ -106,3 +112,3 @@

}
} else {
} else if (style) {
rule.style = convertCase(style);

@@ -109,0 +115,0 @@ }

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.jssCamelCase=t():e.jssCamelCase=t()}(this,function(){return function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t){"use strict";function r(e){return"-"+e.toLowerCase()}function o(e){var t={};for(var o in e){var f=e[o];o=o.replace(n,r),t[o]=f}return t}Object.defineProperty(t,"__esModule",{value:!0});var n=/([A-Z])/g;t["default"]=function(){return function(e){var t=e.style;if(t)if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]=o(t[r]);else e.style=o(t)}}}])});
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.jssCamelCase=r():e.jssCamelCase=r()}(this,function(){return function(e){function r(a){if(t[a])return t[a].exports;var o=t[a]={exports:{},id:a,loaded:!1};return e[a].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var t={};return r.m=e,r.c=t,r.p="",r(0)}([function(e,r){"use strict";function t(e){return"-"+e.toLowerCase()}function a(e){var r={};for(var n in e){var s=e[n];n=n.replace(o,t),r[n]=s}return e.fallbacks&&(Array.isArray(e.fallbacks)?r.fallbacks=e.fallbacks.map(a):r.fallbacks=a(e.fallbacks)),r}Object.defineProperty(r,"__esModule",{value:!0});var o=/([A-Z])/g;r["default"]=function(){return function(e){var r=e.style;if(r)if(Array.isArray(r))for(var t=0;t<r.length;t++)r[t]=a(r[t]);else r&&(e.style=a(r))}}}])});

@@ -18,15 +18,21 @@ "use strict";

/**
* Convert camel cased properties of a single style to dasherized.
* Convert camel cased property names to dash separated.
*
* @param {Object} style
* @return {Object} convertedStyle
* @return {Object}
*/
function convertCase(style) {
var convertedStyle = {};
var converted = {};
for (var prop in style) {
var value = style[prop];
prop = prop.replace(regExp, replace);
convertedStyle[prop] = value;
converted[prop] = value;
}
return convertedStyle;
if (style.fallbacks) {
if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);
}
return converted;
}

@@ -50,3 +56,3 @@

}
} else {
} else if (style) {
rule.style = convertCase(style);

@@ -53,0 +59,0 @@ }

{
"name": "jss-camel-case",
"description": "JSS plugin that allows to write camel cased rule properties",
"version": "2.0.0",
"version": "2.0.1",
"author": {

@@ -11,3 +11,3 @@ "name": "Oleg Slobodskoi",

"type": "git",
"url": "git@github.com:jsstyles/jss-camel-case.git"
"url": "git@github.com:cssinjs/jss-camel-case.git"
},

@@ -14,0 +14,0 @@ "keywords": [

@@ -7,7 +7,10 @@ ![JSS logo](https://avatars1.githubusercontent.com/u/9503099?v=3&s=60)

[Demo](http://jsstyles.github.io/examples/index.html#plugin-jss-camel-case) -
[JSS](https://github.com/jsstyles/jss)
Make sure you read [how to use
plugins](https://github.com/cssinjs/jss/blob/master/docs/setup.md#setup-with-plugins)
in general.
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/jsstyles/jss?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[Demo](http://cssinjs.github.io/examples/index.html#plugin-jss-camel-case) -
[JSS](https://github.com/cssinjs/jss)
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/cssinjs/lobby)

@@ -51,3 +54,3 @@ ## Usage example

File a bug against [jsstyles/jss prefixed with \[jss-camel-case\]](https://github.com/jsstyles/jss/issues/new?title=[jss-camel-case]%20).
File a bug against [cssinjs/jss prefixed with \[jss-camel-case\]](https://github.com/cssinjs/jss/issues/new?title=[jss-camel-case]%20).

@@ -54,0 +57,0 @@ ## Run tests

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