@fower/utils
Advanced tools
Comparing version 1.33.0 to 1.34.0
@@ -105,3 +105,3 @@ 'use strict'; | ||
function camel(str) { | ||
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function (word, index) { | ||
return str.replace(/(?:^\w|[A-Z]|\b\w)|(?<=_)[a-z]/g, function (word, index) { | ||
return index === 0 ? word.toLowerCase() : word.toUpperCase(); | ||
@@ -108,0 +108,0 @@ }).replace(/(\s+|-|_)/g, ''); |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=(e=require("string-hash"))&&"object"==typeof e&&"default"in e?e.default:e;function t(){return(t=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function n(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var o="object"==typeof window&&"object"==typeof document&&9===document.nodeType;function s(e){return void 0===e&&(e=""),e.replace(/^[A-Z]/,(function(e){return e.toLowerCase()}))}function i(e){return s(e).replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()})).replace(/-+/g,"-")}exports.hash=r,exports.argsToProps=function(e){var r=e.reduce((function(e,r){if("string"==typeof r&&"className"!==r&&(e[r]=!0),"object"!=typeof r)return e;if(Array.isArray(r))for(var o,s=function(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return n(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,void 0):void 0}}(e))){t&&(e=t);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r);!(o=s()).done;)e[o.value]=!0;else e.css=t({},e.css,r);return e}),{css:{}}),o=r.css;return t({},function(e,r){if(null==e)return{};var t,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)r.indexOf(t=s[n])>=0||(o[t]=e[t]);return o}(r,["css"]),{css:o})},exports.camel=function(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,(function(e,r){return 0===r?e.toLowerCase():e.toUpperCase()})).replace(/(\s+|-|_)/g,"")},exports.downFirst=s,exports.isBrowser=o,exports.isEmptyObj=function(e){return!e||!Object.keys(e).length},exports.isNumber=function(e){return/^-?[0-9.]+$/.test(e)},exports.isPercentNumber=function(e){return/^-?\d+p$/.test(e)},exports.jsKeyToCssKey=function(e){return/^[A-Z].+$/.test(e)?"-"+i(e):i(e)},exports.kebab=i,exports.objectToClassName=function(e,t){return void 0===t&&(t="css-"),t+r(JSON.stringify(e))},exports.upFirst=function(e){return void 0===e&&(e=""),e.replace(/^[a-z]/,(function(e){return e.toUpperCase()}))}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=(e=require("string-hash"))&&"object"==typeof e&&"default"in e?e.default:e;function t(){return(t=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function n(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var o="object"==typeof window&&"object"==typeof document&&9===document.nodeType;function s(e){return void 0===e&&(e=""),e.replace(/^[A-Z]/,(function(e){return e.toLowerCase()}))}function i(e){return s(e).replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()})).replace(/-+/g,"-")}exports.hash=r,exports.argsToProps=function(e){var r=e.reduce((function(e,r){if("string"==typeof r&&"className"!==r&&(e[r]=!0),"object"!=typeof r)return e;if(Array.isArray(r))for(var o,s=function(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return n(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,void 0):void 0}}(e))){t&&(e=t);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r);!(o=s()).done;)e[o.value]=!0;else e.css=t({},e.css,r);return e}),{css:{}}),o=r.css;return t({},function(e,r){if(null==e)return{};var t,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)r.indexOf(t=s[n])>=0||(o[t]=e[t]);return o}(r,["css"]),{css:o})},exports.camel=function(e){return e.replace(/(?:^\w|[A-Z]|\b\w)|(?<=_)[a-z]/g,(function(e,r){return 0===r?e.toLowerCase():e.toUpperCase()})).replace(/(\s+|-|_)/g,"")},exports.downFirst=s,exports.isBrowser=o,exports.isEmptyObj=function(e){return!e||!Object.keys(e).length},exports.isNumber=function(e){return/^-?[0-9.]+$/.test(e)},exports.isPercentNumber=function(e){return/^-?\d+p$/.test(e)},exports.jsKeyToCssKey=function(e){return/^[A-Z].+$/.test(e)?"-"+i(e):i(e)},exports.kebab=i,exports.objectToClassName=function(e,t){return void 0===t&&(t="css-"),t+r(JSON.stringify(e))},exports.upFirst=function(e){return void 0===e&&(e=""),e.replace(/^[a-z]/,(function(e){return e.toUpperCase()}))}; | ||
//# sourceMappingURL=utils.cjs.production.min.js.map |
@@ -100,3 +100,3 @@ import hash from 'string-hash'; | ||
function camel(str) { | ||
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function (word, index) { | ||
return str.replace(/(?:^\w|[A-Z]|\b\w)|(?<=_)[a-z]/g, function (word, index) { | ||
return index === 0 ? word.toLowerCase() : word.toUpperCase(); | ||
@@ -103,0 +103,0 @@ }).replace(/(\s+|-|_)/g, ''); |
{ | ||
"name": "@fower/utils", | ||
"version": "1.33.0", | ||
"version": "1.34.0", | ||
"license": "MIT", | ||
@@ -27,3 +27,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "de61c79906c88b4828b1976b3cbfd651b1302060" | ||
"gitHead": "132b10dc2050d4102dd5a42f13bad2a0482839a3" | ||
} |
Sorry, the diff of this file is not supported yet
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
28292