rtl-css-js
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -286,3 +286,3 @@ 'use strict'; | ||
function isObject(val) { | ||
return (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object'; | ||
return val && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object'; | ||
} | ||
@@ -289,0 +289,0 @@ |
@@ -357,3 +357,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
function isObject(val) { | ||
return (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object'; | ||
return val && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object'; | ||
} | ||
@@ -360,0 +360,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(r,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.rtlCSSJS=t():r.rtlCSSJS=t()}(this,function(){return function(r){function t(n){if(e[n])return e[n].exports;var o=e[n]={exports:{},id:n,loaded:!1};return r[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var e={};return t.m=r,t.c=e,t.p="",t(0)}([function(r,t,e){"use strict";var n=e(1);r.exports=n.default;for(var o in n)n.hasOwnProperty(o)&&(r.exports[o]=n[o])},function(r,t){"use strict";function e(r){return Object.keys(r).reduce(function(t,e){var o=r[e];s(o)&&(o=o.trim());var i=n(e,o),u=i.key,a=i.value;return t[u]=a,t},{})}function n(r,t){var e=/\/\*\s?@noflip\s?\*\//.test(t),n=e?r:o(r),u=e?t:i(n,t);return{key:n,value:u}}function o(r){return h[r]||r}function i(r,t){if(l(t))return e(t);var n=d(t),o=n?t:t.replace(/ !important.*?$/,""),i=!n&&o.length!==t.length,u=m[r],a=void 0;return a=u?u(o):y[o]||o,i?a+" !important":a}function u(r){return r.replace(/ +/g," ").split(" ").map(function(r){return r.trim()}).filter(Boolean).reduce(function(r,t){var e=r.list,n=r.state,o=(t.match(/\(/g)||[]).length,i=(t.match(/\)/g)||[]).length;return n.parensDepth>0?e[e.length-1]=e[e.length-1]+" "+t:e.push(t),n.parensDepth+=o-i,{list:e,state:n}},{list:[],state:{parensDepth:0}}).list}function a(r){var t=u(r);if(t.length<=3||t.length>4)return r;var e=b(t,4),n=e[0],o=e[1],i=e[2],a=e[3];return[n,a,i,o].join(" ")}function f(r){var t=r.indexOf(".");if(t===-1)r=100-parseFloat(r)+"%";else{var e=r.length-t-2;r=100-parseFloat(r),r=r.toFixed(e)+"%"}return r}function c(r){return r.reduce(function(r,t){var e=b(t,2),n=e[0],o=e[1];return r[n]=o,r[o]=n,r},{})}function d(r){return"number"==typeof r}function l(r){return"object"===("undefined"==typeof r?"undefined":g(r))}function s(r){return"string"==typeof r}function p(r,t){return r.indexOf(t)!==-1}Object.defineProperty(t,"__esModule",{value:!0});var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},b=function(){function r(r,t){var e=[],n=!0,o=!1,i=void 0;try{for(var u,a=r[Symbol.iterator]();!(n=(u=a.next()).done)&&(e.push(u.value),!t||e.length!==t);n=!0);}catch(r){o=!0,i=r}finally{try{!n&&a.return&&a.return()}finally{if(o)throw i}}return e}return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return r(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=c([["paddingLeft","paddingRight"],["marginLeft","marginRight"],["left","right"],["borderLeft","borderRight"],["borderLeftColor","borderRightColor"],["borderLeftStyle","borderRightStyle"],["borderTopLeftRadius","borderTopRightRadius"],["borderBottomLeftRadius","borderBottomRightRadius"]]),y=c([["ltr","rtl"],["left","right"],["w-resize","e-resize"],["sw-resize","se-resize"],["nw-resize","ne-resize"]]),m={padding:function(r){return d(r)?r:a(r)},textShadow:function(r){return r.replace(/(-*)([.|\d]+)/,function(r,t,e){if("0"===e)return r;var n=""===t?"-":"";return""+n+e})},borderColor:function(r){return a(r)},borderRadius:function(r){if(d(r))return r;if(p(r,"/")){var t=r.split("/"),e=b(t,2),n=e[0],o=e[1],i=m.borderRadius(n.trim()),a=m.borderRadius(o.trim());return i+" / "+a}var f=u(r);switch(f.length){case 2:return f.reverse().join(" ");case 4:var c=b(f,4),l=c[0],s=c[1],g=c[2],h=c[3];return[s,l,h,g].join(" ");default:return r}},background:function(r){var t=r.replace(/(url\(.*?\))|(rgba?\(.*?\))|(hsl\(.*?\))|(#[a-fA-F0-9]+)|((^| )(\D)+( |$))/g,"").trim();return r=r.replace(t,m.backgroundPosition(t)),m.backgroundImage(r)},backgroundImage:function(r){return p(r,"url(")?r.replace(/(^|\W|_)((ltr)|(rtl)|(left)|(right))(\W|_|$)/g,function(r,t,e){return r.replace(e,y[e])}):r},backgroundPosition:function(r){return r.replace(/^((-|\d|\.)+%)/,function(r,t){return f(t)}).replace(/(left)|(right)/,function(r){return y[r]})},backgroundPositionX:function(r){return d(r)?r:m.backgroundPosition(r)}};m.margin=m.padding,m.borderWidth=m.padding,m.boxShadow=m.textShadow,m.webkitBoxShadow=m.textShadow,m.mozBoxShadow=m.textShadow,m.borderStyle=m.borderColor,t.default=e}])}); | ||
!function(r,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.rtlCSSJS=t():r.rtlCSSJS=t()}(this,function(){return function(r){function t(n){if(e[n])return e[n].exports;var o=e[n]={exports:{},id:n,loaded:!1};return r[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var e={};return t.m=r,t.c=e,t.p="",t(0)}([function(r,t,e){"use strict";var n=e(1);r.exports=n.default;for(var o in n)n.hasOwnProperty(o)&&(r.exports[o]=n[o])},function(r,t){"use strict";function e(r){return Object.keys(r).reduce(function(t,e){var o=r[e];s(o)&&(o=o.trim());var i=n(e,o),u=i.key,a=i.value;return t[u]=a,t},{})}function n(r,t){var e=/\/\*\s?@noflip\s?\*\//.test(t),n=e?r:o(r),u=e?t:i(n,t);return{key:n,value:u}}function o(r){return h[r]||r}function i(r,t){if(l(t))return e(t);var n=d(t),o=n?t:t.replace(/ !important.*?$/,""),i=!n&&o.length!==t.length,u=m[r],a=void 0;return a=u?u(o):y[o]||o,i?a+" !important":a}function u(r){return r.replace(/ +/g," ").split(" ").map(function(r){return r.trim()}).filter(Boolean).reduce(function(r,t){var e=r.list,n=r.state,o=(t.match(/\(/g)||[]).length,i=(t.match(/\)/g)||[]).length;return n.parensDepth>0?e[e.length-1]=e[e.length-1]+" "+t:e.push(t),n.parensDepth+=o-i,{list:e,state:n}},{list:[],state:{parensDepth:0}}).list}function a(r){var t=u(r);if(t.length<=3||t.length>4)return r;var e=b(t,4),n=e[0],o=e[1],i=e[2],a=e[3];return[n,a,i,o].join(" ")}function f(r){var t=r.indexOf(".");if(t===-1)r=100-parseFloat(r)+"%";else{var e=r.length-t-2;r=100-parseFloat(r),r=r.toFixed(e)+"%"}return r}function c(r){return r.reduce(function(r,t){var e=b(t,2),n=e[0],o=e[1];return r[n]=o,r[o]=n,r},{})}function d(r){return"number"==typeof r}function l(r){return r&&"object"===("undefined"==typeof r?"undefined":g(r))}function s(r){return"string"==typeof r}function p(r,t){return r.indexOf(t)!==-1}Object.defineProperty(t,"__esModule",{value:!0});var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},b=function(){function r(r,t){var e=[],n=!0,o=!1,i=void 0;try{for(var u,a=r[Symbol.iterator]();!(n=(u=a.next()).done)&&(e.push(u.value),!t||e.length!==t);n=!0);}catch(r){o=!0,i=r}finally{try{!n&&a.return&&a.return()}finally{if(o)throw i}}return e}return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return r(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=c([["paddingLeft","paddingRight"],["marginLeft","marginRight"],["left","right"],["borderLeft","borderRight"],["borderLeftColor","borderRightColor"],["borderLeftStyle","borderRightStyle"],["borderTopLeftRadius","borderTopRightRadius"],["borderBottomLeftRadius","borderBottomRightRadius"]]),y=c([["ltr","rtl"],["left","right"],["w-resize","e-resize"],["sw-resize","se-resize"],["nw-resize","ne-resize"]]),m={padding:function(r){return d(r)?r:a(r)},textShadow:function(r){return r.replace(/(-*)([.|\d]+)/,function(r,t,e){if("0"===e)return r;var n=""===t?"-":"";return""+n+e})},borderColor:function(r){return a(r)},borderRadius:function(r){if(d(r))return r;if(p(r,"/")){var t=r.split("/"),e=b(t,2),n=e[0],o=e[1],i=m.borderRadius(n.trim()),a=m.borderRadius(o.trim());return i+" / "+a}var f=u(r);switch(f.length){case 2:return f.reverse().join(" ");case 4:var c=b(f,4),l=c[0],s=c[1],g=c[2],h=c[3];return[s,l,h,g].join(" ");default:return r}},background:function(r){var t=r.replace(/(url\(.*?\))|(rgba?\(.*?\))|(hsl\(.*?\))|(#[a-fA-F0-9]+)|((^| )(\D)+( |$))/g,"").trim();return r=r.replace(t,m.backgroundPosition(t)),m.backgroundImage(r)},backgroundImage:function(r){return p(r,"url(")?r.replace(/(^|\W|_)((ltr)|(rtl)|(left)|(right))(\W|_|$)/g,function(r,t,e){return r.replace(e,y[e])}):r},backgroundPosition:function(r){return r.replace(/^((-|\d|\.)+%)/,function(r,t){return f(t)}).replace(/(left)|(right)/,function(r){return y[r]})},backgroundPositionX:function(r){return d(r)?r:m.backgroundPosition(r)}};m.margin=m.padding,m.borderWidth=m.padding,m.boxShadow=m.textShadow,m.webkitBoxShadow=m.textShadow,m.mozBoxShadow=m.textShadow,m.borderStyle=m.borderColor,t.default=e}])}); | ||
//# sourceMappingURL=index.umd.min.js.map |
{ | ||
"name": "rtl-css-js", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "RTL conversion for CSS in JS objects", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96576