const { DEVICE_LEVEL } = require('../../lite/lite-enum') /** * rules: * - abc-def -> abcDef * - -abc-def -> AbcDef * * @param {string} value * @return {string} */ exports.hyphenedToCamelCase = function hyphenedToCamelCase(value) { return value.replace(/(? abc-def * - AbcDef -> -abc-def * * @param {string} value * @return {string} */ exports.camelCaseToHyphened = function camelCaseToHyphened(value) { return value.replace(/([A-Z])/g, function(s, m) { if (typeof m === 'string') { return '-' + m.toLowerCase() } return m }) } exports.isValidValue = function isValidValue(value) { return "number" == typeof value || "string" == typeof value } /** * rules: * assign abbreviated values to expanded attributes * margin:1px 2px -> marginTop:1px;marginRight:2px;marginBottom:1px;marginLeft:2px; * * @param {obejct} object * @param {string} value * @param {obejct} spliceName */ exports.splitAttr = function (object, value, spliceName) { const values = value.toString().trim().split(/(?