jss-plugin-camel-case
Advanced tools
Comparing version 10.0.0-alpha.14 to 10.0.0-alpha.15
@@ -30,3 +30,3 @@ /* eslint-disable no-var, prefer-template */ | ||
for (var prop in style) { | ||
var key = prop.startsWith('--') ? prop : hyphenateStyleName(prop); | ||
var key = prop.indexOf('--') === 0 ? prop : hyphenateStyleName(prop); | ||
converted[key] = style[prop]; | ||
@@ -63,3 +63,3 @@ } | ||
function onChangeValue(value, prop, rule) { | ||
if (prop.startsWith('--')) { | ||
if (prop.indexOf('--') === 0) { | ||
return value; | ||
@@ -66,0 +66,0 @@ } |
@@ -20,3 +20,3 @@ 'use strict'; | ||
for (var prop in style) { | ||
var key = prop.startsWith('--') ? prop : hyphenate(prop); | ||
var key = prop.indexOf('--') === 0 ? prop : hyphenate(prop); | ||
converted[key] = style[prop]; | ||
@@ -53,3 +53,3 @@ } | ||
function onChangeValue(value, prop, rule) { | ||
if (prop.startsWith('--')) { | ||
if (prop.indexOf('--') === 0) { | ||
return value; | ||
@@ -56,0 +56,0 @@ } |
@@ -14,3 +14,3 @@ import hyphenate from 'hyphenate-style-name'; | ||
for (var prop in style) { | ||
var key = prop.startsWith('--') ? prop : hyphenate(prop); | ||
var key = prop.indexOf('--') === 0 ? prop : hyphenate(prop); | ||
converted[key] = style[prop]; | ||
@@ -47,3 +47,3 @@ } | ||
function onChangeValue(value, prop, rule) { | ||
if (prop.startsWith('--')) { | ||
if (prop.indexOf('--') === 0) { | ||
return value; | ||
@@ -50,0 +50,0 @@ } |
@@ -36,3 +36,3 @@ (function (global, factory) { | ||
for (var prop in style) { | ||
var key = prop.startsWith('--') ? prop : hyphenateStyleName(prop); | ||
var key = prop.indexOf('--') === 0 ? prop : hyphenateStyleName(prop); | ||
converted[key] = style[prop]; | ||
@@ -69,3 +69,3 @@ } | ||
function onChangeValue(value, prop, rule) { | ||
if (prop.startsWith('--')) { | ||
if (prop.indexOf('--') === 0) { | ||
return value; | ||
@@ -72,0 +72,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self).jssPluginCamelCase={})}(this,function(e){"use strict";var r=/[A-Z]/g,t=/^ms-/,n={};function a(e){return"-"+e.toLowerCase()}function f(e){if(n.hasOwnProperty(e))return n[e];var f=e.replace(r,a);return n[e]=t.test(f)?"-"+f:f}function s(e){var r={};for(var t in e){r[t.startsWith("--")?t:f(t)]=e[t]}return e.fallbacks&&(Array.isArray(e.fallbacks)?r.fallbacks=e.fallbacks.map(s):r.fallbacks=s(e.fallbacks)),r}e.default=function(){return{onProcessStyle:function(e){if(Array.isArray(e)){for(var r=0;r<e.length;r++)e[r]=s(e[r]);return e}return s(e)},onChangeValue:function(e,r,t){if(r.startsWith("--"))return e;var n=f(r);return r===n?e:(t.prop(n,e),null)}}},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self).jssPluginCamelCase={})}(this,function(e){"use strict";var r=/[A-Z]/g,n=/^ms-/,t={};function a(e){return"-"+e.toLowerCase()}function f(e){if(t.hasOwnProperty(e))return t[e];var f=e.replace(r,a);return t[e]=n.test(f)?"-"+f:f}function o(e){var r={};for(var n in e){r[0===n.indexOf("--")?n:f(n)]=e[n]}return e.fallbacks&&(Array.isArray(e.fallbacks)?r.fallbacks=e.fallbacks.map(o):r.fallbacks=o(e.fallbacks)),r}e.default=function(){return{onProcessStyle:function(e){if(Array.isArray(e)){for(var r=0;r<e.length;r++)e[r]=o(e[r]);return e}return o(e)},onChangeValue:function(e,r,n){if(0===r.indexOf("--"))return e;var t=f(r);return r===t?e:(n.prop(t,e),null)}}},Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "jss-plugin-camel-case", | ||
"description": "JSS plugin that allows to write camel cased rule properties", | ||
"version": "10.0.0-alpha.14", | ||
"version": "10.0.0-alpha.15", | ||
"license": "MIT", | ||
@@ -47,3 +47,3 @@ "homepage": "https://cssinjs.org/jss-camel-case", | ||
}, | ||
"gitHead": "2238961a6e853df27aa1af6052b62cfc30873587" | ||
"gitHead": "66d976859f0d2378ed929d721abb7e9ec1d4371f" | ||
} |
@@ -12,3 +12,3 @@ # jss-plugin-camel-case | ||
See our website [jss-plugin-camel-case](https://cssinjs.org/jss-plugin-camel-case?v=v10.0.0-alpha.14) for more information. | ||
See our website [jss-plugin-camel-case](https://cssinjs.org/jss-plugin-camel-case?v=v10.0.0-alpha.15) for more information. | ||
@@ -15,0 +15,0 @@ ## Install |
@@ -15,3 +15,3 @@ // @flow | ||
for (const prop in style) { | ||
const key = prop.startsWith('--') ? prop : hyphenate(prop) | ||
const key = prop.indexOf('--') === 0 ? prop : hyphenate(prop) | ||
@@ -48,3 +48,3 @@ converted[key] = style[prop] | ||
function onChangeValue(value, prop, rule) { | ||
if (prop.startsWith('--')) { | ||
if (prop.indexOf('--') === 0) { | ||
return value | ||
@@ -51,0 +51,0 @@ } |
Sorry, the diff of this file is not supported yet
22233