Comparing version 1.0.1-alpha.0 to 1.0.1-alpha.1
@@ -1,1 +0,1 @@ | ||
{"errors":[],"warnings":[],"version":"4.30.0","hash":"8d6427eb9da8eb6c9649","time":1166,"builtAt":1562840288950,"publicPath":"","outputPath":"/Users/alicia/Documents/develop/github/heyui/hey-utils/build","assetsByChunkName":{"main":"utils.js"},"assets":[{"name":"utils.js","size":8978,"chunks":[0],"chunkNames":["main"],"emitted":true}],"filteredAssets":0,"entrypoints":{"main":{"chunks":[0],"assets":["utils.js"],"children":{},"childAssets":{}}},"namedChunkGroups":{"main":{"chunks":[0],"assets":["utils.js"],"children":{},"childAssets":{}}},"chunks":[{"id":0,"rendered":true,"initial":true,"entry":true,"size":16121,"names":["main"],"files":["utils.js"],"hash":"5ef6be6c491d33394166","siblings":[],"parents":[],"children":[],"childrenByOrder":{},"modules":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js","index":0,"index2":3,"size":28,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":null,"issuerId":null,"issuerName":null,"issuerPath":null,"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":null,"moduleIdentifier":null,"module":null,"moduleName":null,"type":"multi entry"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":0},{"id":1,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"./src/index.js","index":1,"index2":2,"size":15129,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","issuerId":0,"issuerName":"multi ./src/index.js","issuerPath":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":0,"moduleIdentifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","module":"multi ./src/index.js","moduleName":"multi ./src/index.js","type":"single entry","userRequest":"/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","loc":"main[0]"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":1,"source":"\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _typeof2 = _interopRequireDefault(require(\"@babel/runtime/helpers/typeof\"));\n\nvar heythis = {\n isObject: function isObject(input) {\n return Object.prototype.toString.call(input) === '[object Object]';\n },\n isArray: function isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n },\n isDate: function isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n },\n isNumber: function isNumber(input) {\n return input instanceof Number || Object.prototype.toString.call(input) === '[object Number]';\n },\n isString: function isString(input) {\n return input instanceof String || Object.prototype.toString.call(input) === '[object String]';\n },\n isBoolean: function isBoolean(input) {\n return typeof input == 'boolean';\n },\n isFunction: function isFunction(input) {\n return typeof input == 'function';\n },\n isNull: function isNull(input) {\n return input === undefined || input === null;\n },\n isPlainObject: function isPlainObject(obj) {\n if (obj && Object.prototype.toString.call(obj) === \"[object Object]\" && obj.constructor === Object && !hasOwnProperty.call(obj, \"constructor\")) {\n var key;\n\n for (key in obj) {}\n\n return key === undefined || hasOwnProperty.call(obj, key);\n }\n\n return false;\n },\n extend: function extend() {\n var options,\n name,\n src,\n copy,\n copyIsArray,\n clone,\n target = arguments[0] || {},\n i = 1,\n length = arguments.length,\n deep = false;\n\n if (typeof target === \"boolean\") {\n deep = target;\n target = arguments[1] || {};\n i = 2;\n }\n\n if ((0, _typeof2.default)(target) !== \"object\" && !this.isFunction(target)) {\n target = {};\n }\n\n if (length === i) {\n target = this;\n --i;\n }\n\n for (; i < length; i++) {\n if ((options = arguments[i]) != null) {\n for (name in options) {\n src = target[name];\n copy = options[name];\n\n if (src === copy) {\n continue;\n }\n\n if (deep && copy && (this.isPlainObject(copy) || (copyIsArray = this.isArray(copy)))) {\n if (copyIsArray) {\n copyIsArray = false;\n clone = src && this.isArray(src) ? src : [];\n } else {\n clone = src && this.isPlainObject(src) ? src : {};\n }\n\n target[name] = this.extend(deep, clone, copy);\n } else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n }\n\n return target;\n },\n freeze: function freeze(obj) {\n var _this = this;\n\n var that = this;\n Object.freeze(obj);\n Object.keys(obj).forEach(function (key, value) {\n if (that.isObject(obj[key])) {\n _this.freeze(obj[key]);\n }\n });\n return obj;\n },\n copy: function copy(data) {\n var copyOne = null;\n\n if (this.isObject(data)) {\n copyOne = {};\n\n for (var key in data) {\n copyOne[key] = this.copy(data[key]);\n }\n } else if (this.isArray(data)) {\n copyOne = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var index = _step.value;\n copyOne.push(this.copy(index));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } else {\n copyOne = data;\n }\n\n return copyOne;\n },\n getKeyValue: function getKeyValue(obj, keypath) {\n if (!this.isObject(obj)) {\n return null;\n }\n\n var array = null;\n\n if (this.isArray(keypath)) {\n array = keypath;\n } else if (this.isString(keypath)) {\n array = keypath.split('.');\n }\n\n if (array == null || array.length == 0) {\n return null;\n }\n\n var value = null;\n var key = array.shift();\n var keyTest = key.match(new RegExp(\"^(\\\\w+)\\\\[(\\\\d+)\\\\]$\"));\n\n if (keyTest) {\n key = keyTest[1];\n var index = keyTest[2];\n value = obj[key];\n\n if (this.isArray(value) && value.length > index) {\n value = value[index];\n }\n } else {\n value = obj[key];\n }\n\n if (array.length > 0) {\n return this.getKeyValue(value, array);\n }\n\n return value;\n },\n setKeyValue: function setKeyValue(obj, keypath, value, orignal) {\n if (!this.isObject(obj)) {\n return false;\n }\n\n var array = null;\n\n if (this.isArray(keypath)) {\n array = keypath;\n } else if (this.isString(keypath)) {\n array = keypath.split('.');\n orignal = obj;\n }\n\n if (array == null || array.length == 0) {\n return false;\n }\n\n var children = null;\n var index = 0;\n var key = array.shift();\n var keyTest = key.match(new RegExp(\"^(\\\\w+)\\\\[(\\\\d+)\\\\]$\"));\n\n if (keyTest) {\n key = keyTest[1];\n index = keyTest[2];\n children = obj[key];\n\n if (this.isArray(children) && children.length > index) {\n if (array.length > 0) {\n return this.setKeyValue(children[index], array, value, orignal);\n }\n\n children[index] = value;\n }\n } else {\n if (array.length > 0) {\n return this.setKeyValue(obj[key], array, value, orignal);\n }\n\n obj[key] = value;\n }\n\n return orignal;\n },\n toArray: function toArray(object, keyName, arg3) {\n var titleName = '';\n\n if (!this.isObject(object)) {\n return [];\n }\n\n if (this.isString(arg3)) {\n titleName = arg3;\n }\n\n var listO = [];\n\n for (var i in object) {\n var value = object[i];\n var n = {};\n\n if (this.isObject(value)) {\n n = value;\n } else {\n n[titleName] = value;\n }\n\n if (keyName) n[keyName] = i;\n listO.push(n);\n }\n\n return listO;\n },\n toObject: function toObject(list) {\n var idName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';\n var hasNum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var listO = {};\n\n for (var i = 0; i < list.length; i++) {\n var n = list[i];\n\n if (this.isObject(n)) {\n if (idName == 'count') {\n listO[i] = n;\n } else {\n listO[n[idName]] = n;\n\n if (hasNum) {\n listO[n[idName]].count = i;\n }\n }\n } else {\n listO[n] = n;\n }\n }\n\n return listO;\n },\n saveLocal: function saveLocal(name, value) {\n if (window.localStorage && JSON && name) {\n if ((0, _typeof2.default)(value) == 'object') {\n value = JSON.stringify(value);\n }\n\n window.localStorage.setItem('name', value);\n return true;\n }\n\n return false;\n },\n getLocal: function getLocal(name, type) {\n if (window.localStorage && JSON && name) {\n var data = window.localStorage.getItem(name);\n\n if (type && type == 'json' && data !== undefined) {\n try {\n return JSON.parse(data);\n } catch (e) {\n console.error(\"\\u53D6\\u6570\\u8F6C\\u6362json\\u9519\\u8BEF\".concat(e));\n return '';\n }\n } else {\n return data;\n }\n }\n\n return null;\n },\n getLocal2Json: function getLocal2Json(name) {\n if (window.localStorage && JSON && name) {\n var data = window.localStorage.getItem(name);\n\n if (!this.isNull(data)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n console.error(\"\\u53D6\\u6570\\u8F6C\\u6362json\\u9519\\u8BEF\".concat(e));\n return '';\n }\n } else {\n return data;\n }\n }\n\n return null;\n },\n removeLocal: function removeLocal(name) {\n if (window.localStorage && JSON && name) {\n window.localStorage.removeItem(name);\n }\n\n return null;\n },\n saveCookie: function saveCookie(name, value, domain, path, minSec) {\n var cookieEnabled = navigator.cookieEnabled ? true : false;\n\n if (name && cookieEnabled) {\n path = path || '/';\n\n if ((0, _typeof2.default)(value) == 'object') {\n value = JSON.stringify(value);\n }\n\n var exp;\n\n if (minSec) {\n exp = new Date(); // new Date(\"December 31, 9998\");\n\n exp.setTime(exp.getTime() + minSec * 1000);\n } else {\n exp = new Date(\"9998-01-01\");\n }\n\n var cookieString = \"\".concat(name, \"=\").concat(escape(value)).concat(minSec ? \";expires=\".concat(exp.toGMTString()) : '', \";path=\").concat(path, \";\");\n\n if (domain) {\n cookieString += \"domain=\".concat(domain, \";\");\n }\n\n document.cookie = cookieString;\n return true;\n }\n\n return false;\n },\n getCookie: function getCookie(name) {\n var cookieEnabled = navigator.cookieEnabled ? true : false;\n\n if (name && cookieEnabled) {\n var arr = document.cookie.match(new RegExp(\"(^| )\".concat(name, \"=([^;]*)(;|$)\")));\n\n if (arr !== null) {\n return unescape(arr[2]);\n }\n }\n\n return null;\n },\n clearCookie: function clearCookie(domain, path) {\n var keys = document.cookie.match(/[^ =;]+(?=\\=)/g);\n path = path || '/';\n\n if (keys) {\n for (var i = keys.length; i--;) {\n var cookieString = \"\".concat(keys[i], \"=0;expires=\").concat(new Date(0).toUTCString(), \";path=\").concat(path, \";\");\n\n if (domain) {\n cookieString += \"domain=\".concat(domain, \";\");\n }\n\n document.cookie = cookieString;\n }\n }\n },\n removeCookie: function removeCookie(name, domain, path) {\n var cookieEnabled = navigator.cookieEnabled ? true : false;\n\n if (name && cookieEnabled) {\n path = path || '/';\n var cookieString = \"\".concat(name, \"=0;expires=\").concat(new Date(0).toUTCString(), \";path=\").concat(path, \";\");\n\n if (domain) {\n cookieString += \"domain=\".concat(domain, \";\");\n }\n\n document.cookie = cookieString;\n return true;\n }\n\n return false;\n },\n dictMapping: function dictMapping(_ref) {\n var _this2 = this;\n\n var value = _ref.value,\n dict = _ref.dict,\n connector = _ref.connector,\n _ref$keyField = _ref.keyField,\n keyField = _ref$keyField === void 0 ? 'key' : _ref$keyField,\n _ref$titleField = _ref.titleField,\n titleField = _ref$titleField === void 0 ? 'value' : _ref$titleField;\n if (!dict || this.isNull(value)) return '';\n\n if (connector) {\n value = value.split(connector);\n }\n\n if (!this.isNull(value) && value !== '' && dict) {\n if (!this.isArray(value)) {\n value = [value];\n }\n }\n\n if (value.length <= 0) {\n return '';\n }\n\n if (this.isArray(dict)) {\n dict = this.toObject(dict, keyField);\n }\n\n return value.map(function (ele) {\n if (_this2.isObject(ele)) {\n return ele[titleField];\n }\n\n var d = dict[ele];\n\n if (_this2.isObject(d)) {\n return d[titleField];\n }\n\n return d;\n }).filter(function (ele) {\n return ele && ele !== '';\n }).join(', ');\n },\n uuid: function uuid() {\n var s4 = function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n };\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n },\n padLeft: function padLeft(str, size) {\n var s = \"00000\" + str;\n return s.substr(s.length - size);\n },\n toggleValue: function toggleValue(list, value) {\n if (!this.isArray(list)) return [value];\n var filters = list.filter(function (item) {\n return item == value;\n });\n\n if (filters.length > 0) {\n list.splice(list.indexOf(filters[0]), 1);\n } else {\n list.push(value);\n }\n },\n toSimpleArray: function toSimpleArray(data, key) {\n var r = [];\n\n if (this.isObject(data)) {\n for (var _i = 0, _Object$keys = Object.keys(data); _i < _Object$keys.length; _i++) {\n var d = _Object$keys[_i];\n r.push(data[d][key]);\n }\n }\n\n if (this.isArray(data)) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = data[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _d = _step2.value;\n r.push(_d[key]);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n\n return r;\n },\n getURLParam: function getURLParam(name, search) {\n return decodeURIComponent((new RegExp(\"[?|&]\".concat(name, \"=\") + '([^&;]+?)(&|#|;|$)').exec(search || location.search) || [true, ''])[1].replace(/\\+/g, '%20')) || null;\n },\n getAuthor: function getAuthor() {\n var author = this.getURLParam('author', window.location.search) || this.getLocal('window_author');\n\n if (author) {\n this.saveLocal('window_author', author);\n }\n\n return author;\n },\n add: function add(arg1, arg2) {\n var s1 = arg1.toString();\n var s2 = arg2.toString();\n var arg1Arr = s1.split(\".\");\n var arg2Arr = s2.split(\".\");\n var d1 = arg1Arr.length == 2 ? arg1Arr[1] : \"\";\n var d2 = arg2Arr.length == 2 ? arg2Arr[1] : \"\";\n var maxLen = Math.max(d1.length, d2.length);\n var m = Math.pow(10, maxLen);\n return Number(((s1 * m + s2 * m) / m).toFixed(maxLen));\n },\n sub: function sub(arg1, arg2) {\n return this.add(arg1, -arg2);\n },\n mul: function mul(arg1, arg2) {\n var m = 0;\n var s1 = arg1.toString();\n var s2 = arg2.toString();\n\n try {\n m += s1.split(\".\")[1].length;\n } catch (e) {}\n\n try {\n m += s2.split(\".\")[1].length;\n } catch (e) {}\n\n return Number(s1.replace(\".\", \"\")) * Number(s2.replace(\".\", \"\")) / Math.pow(10, m);\n },\n div: function div(arg1, arg2) {\n var t1 = 0;\n var t2 = 0;\n\n try {\n t1 = arg1.toString().split(\".\")[1].length;\n } catch (e) {}\n\n try {\n t2 = arg2.toString().split(\".\")[1].length;\n } catch (e) {}\n\n var r1 = Number(arg1.toString().replace(\".\", \"\"));\n var r2 = Number(arg2.toString().replace(\".\", \"\"));\n return this.mul(r1 / r2, Math.pow(10, t2 - t1));\n }\n};\nheythis.valueForKeypath = heythis.getKeyValue;\nheythis.setValueForKeypath = heythis.setKeyValue;\nvar _default = heythis;\nexports.default = _default;"},{"id":2,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/@babel/runtime/helpers/interopRequireDefault.js","name":"../hey-cli/node_modules/@babel/runtime/helpers/interopRequireDefault.js","index":2,"index2":0,"size":147,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","issuerId":1,"issuerName":"./src/index.js","issuerPath":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js"},{"id":1,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"./src/index.js"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":1,"moduleIdentifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","module":"./src/index.js","moduleName":"./src/index.js","type":"cjs require","userRequest":"@babel/runtime/helpers/interopRequireDefault","loc":"3:29-84"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":2,"source":"function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;"},{"id":3,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/@babel/runtime/helpers/typeof.js","name":"../hey-cli/node_modules/@babel/runtime/helpers/typeof.js","index":3,"index2":1,"size":817,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","issuerId":1,"issuerName":"./src/index.js","issuerPath":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js"},{"id":1,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"./src/index.js"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":1,"moduleIdentifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","module":"./src/index.js","moduleName":"./src/index.js","type":"cjs require","userRequest":"@babel/runtime/helpers/typeof","loc":"10:38-78"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":2,"source":"function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;"}],"filteredModules":0,"origins":[{"module":"","moduleIdentifier":"","moduleName":"","loc":"main","request":null,"reasons":[]}]}],"modules":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js","index":0,"index2":3,"size":28,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":null,"issuerId":null,"issuerName":null,"issuerPath":null,"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":null,"moduleIdentifier":null,"module":null,"moduleName":null,"type":"multi entry"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":0},{"id":1,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"./src/index.js","index":1,"index2":2,"size":15129,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","issuerId":0,"issuerName":"multi ./src/index.js","issuerPath":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":0,"moduleIdentifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","module":"multi ./src/index.js","moduleName":"multi ./src/index.js","type":"single entry","userRequest":"/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","loc":"main[0]"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":1,"source":"\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _typeof2 = _interopRequireDefault(require(\"@babel/runtime/helpers/typeof\"));\n\nvar heythis = {\n isObject: function isObject(input) {\n return Object.prototype.toString.call(input) === '[object Object]';\n },\n isArray: function isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n },\n isDate: function isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n },\n isNumber: function isNumber(input) {\n return input instanceof Number || Object.prototype.toString.call(input) === '[object Number]';\n },\n isString: function isString(input) {\n return input instanceof String || Object.prototype.toString.call(input) === '[object String]';\n },\n isBoolean: function isBoolean(input) {\n return typeof input == 'boolean';\n },\n isFunction: function isFunction(input) {\n return typeof input == 'function';\n },\n isNull: function isNull(input) {\n return input === undefined || input === null;\n },\n isPlainObject: function isPlainObject(obj) {\n if (obj && Object.prototype.toString.call(obj) === \"[object Object]\" && obj.constructor === Object && !hasOwnProperty.call(obj, \"constructor\")) {\n var key;\n\n for (key in obj) {}\n\n return key === undefined || hasOwnProperty.call(obj, key);\n }\n\n return false;\n },\n extend: function extend() {\n var options,\n name,\n src,\n copy,\n copyIsArray,\n clone,\n target = arguments[0] || {},\n i = 1,\n length = arguments.length,\n deep = false;\n\n if (typeof target === \"boolean\") {\n deep = target;\n target = arguments[1] || {};\n i = 2;\n }\n\n if ((0, _typeof2.default)(target) !== \"object\" && !this.isFunction(target)) {\n target = {};\n }\n\n if (length === i) {\n target = this;\n --i;\n }\n\n for (; i < length; i++) {\n if ((options = arguments[i]) != null) {\n for (name in options) {\n src = target[name];\n copy = options[name];\n\n if (src === copy) {\n continue;\n }\n\n if (deep && copy && (this.isPlainObject(copy) || (copyIsArray = this.isArray(copy)))) {\n if (copyIsArray) {\n copyIsArray = false;\n clone = src && this.isArray(src) ? src : [];\n } else {\n clone = src && this.isPlainObject(src) ? src : {};\n }\n\n target[name] = this.extend(deep, clone, copy);\n } else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n }\n\n return target;\n },\n freeze: function freeze(obj) {\n var _this = this;\n\n var that = this;\n Object.freeze(obj);\n Object.keys(obj).forEach(function (key, value) {\n if (that.isObject(obj[key])) {\n _this.freeze(obj[key]);\n }\n });\n return obj;\n },\n copy: function copy(data) {\n var copyOne = null;\n\n if (this.isObject(data)) {\n copyOne = {};\n\n for (var key in data) {\n copyOne[key] = this.copy(data[key]);\n }\n } else if (this.isArray(data)) {\n copyOne = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var index = _step.value;\n copyOne.push(this.copy(index));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } else {\n copyOne = data;\n }\n\n return copyOne;\n },\n getKeyValue: function getKeyValue(obj, keypath) {\n if (!this.isObject(obj)) {\n return null;\n }\n\n var array = null;\n\n if (this.isArray(keypath)) {\n array = keypath;\n } else if (this.isString(keypath)) {\n array = keypath.split('.');\n }\n\n if (array == null || array.length == 0) {\n return null;\n }\n\n var value = null;\n var key = array.shift();\n var keyTest = key.match(new RegExp(\"^(\\\\w+)\\\\[(\\\\d+)\\\\]$\"));\n\n if (keyTest) {\n key = keyTest[1];\n var index = keyTest[2];\n value = obj[key];\n\n if (this.isArray(value) && value.length > index) {\n value = value[index];\n }\n } else {\n value = obj[key];\n }\n\n if (array.length > 0) {\n return this.getKeyValue(value, array);\n }\n\n return value;\n },\n setKeyValue: function setKeyValue(obj, keypath, value, orignal) {\n if (!this.isObject(obj)) {\n return false;\n }\n\n var array = null;\n\n if (this.isArray(keypath)) {\n array = keypath;\n } else if (this.isString(keypath)) {\n array = keypath.split('.');\n orignal = obj;\n }\n\n if (array == null || array.length == 0) {\n return false;\n }\n\n var children = null;\n var index = 0;\n var key = array.shift();\n var keyTest = key.match(new RegExp(\"^(\\\\w+)\\\\[(\\\\d+)\\\\]$\"));\n\n if (keyTest) {\n key = keyTest[1];\n index = keyTest[2];\n children = obj[key];\n\n if (this.isArray(children) && children.length > index) {\n if (array.length > 0) {\n return this.setKeyValue(children[index], array, value, orignal);\n }\n\n children[index] = value;\n }\n } else {\n if (array.length > 0) {\n return this.setKeyValue(obj[key], array, value, orignal);\n }\n\n obj[key] = value;\n }\n\n return orignal;\n },\n toArray: function toArray(object, keyName, arg3) {\n var titleName = '';\n\n if (!this.isObject(object)) {\n return [];\n }\n\n if (this.isString(arg3)) {\n titleName = arg3;\n }\n\n var listO = [];\n\n for (var i in object) {\n var value = object[i];\n var n = {};\n\n if (this.isObject(value)) {\n n = value;\n } else {\n n[titleName] = value;\n }\n\n if (keyName) n[keyName] = i;\n listO.push(n);\n }\n\n return listO;\n },\n toObject: function toObject(list) {\n var idName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';\n var hasNum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var listO = {};\n\n for (var i = 0; i < list.length; i++) {\n var n = list[i];\n\n if (this.isObject(n)) {\n if (idName == 'count') {\n listO[i] = n;\n } else {\n listO[n[idName]] = n;\n\n if (hasNum) {\n listO[n[idName]].count = i;\n }\n }\n } else {\n listO[n] = n;\n }\n }\n\n return listO;\n },\n saveLocal: function saveLocal(name, value) {\n if (window.localStorage && JSON && name) {\n if ((0, _typeof2.default)(value) == 'object') {\n value = JSON.stringify(value);\n }\n\n window.localStorage.setItem('name', value);\n return true;\n }\n\n return false;\n },\n getLocal: function getLocal(name, type) {\n if (window.localStorage && JSON && name) {\n var data = window.localStorage.getItem(name);\n\n if (type && type == 'json' && data !== undefined) {\n try {\n return JSON.parse(data);\n } catch (e) {\n console.error(\"\\u53D6\\u6570\\u8F6C\\u6362json\\u9519\\u8BEF\".concat(e));\n return '';\n }\n } else {\n return data;\n }\n }\n\n return null;\n },\n getLocal2Json: function getLocal2Json(name) {\n if (window.localStorage && JSON && name) {\n var data = window.localStorage.getItem(name);\n\n if (!this.isNull(data)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n console.error(\"\\u53D6\\u6570\\u8F6C\\u6362json\\u9519\\u8BEF\".concat(e));\n return '';\n }\n } else {\n return data;\n }\n }\n\n return null;\n },\n removeLocal: function removeLocal(name) {\n if (window.localStorage && JSON && name) {\n window.localStorage.removeItem(name);\n }\n\n return null;\n },\n saveCookie: function saveCookie(name, value, domain, path, minSec) {\n var cookieEnabled = navigator.cookieEnabled ? true : false;\n\n if (name && cookieEnabled) {\n path = path || '/';\n\n if ((0, _typeof2.default)(value) == 'object') {\n value = JSON.stringify(value);\n }\n\n var exp;\n\n if (minSec) {\n exp = new Date(); // new Date(\"December 31, 9998\");\n\n exp.setTime(exp.getTime() + minSec * 1000);\n } else {\n exp = new Date(\"9998-01-01\");\n }\n\n var cookieString = \"\".concat(name, \"=\").concat(escape(value)).concat(minSec ? \";expires=\".concat(exp.toGMTString()) : '', \";path=\").concat(path, \";\");\n\n if (domain) {\n cookieString += \"domain=\".concat(domain, \";\");\n }\n\n document.cookie = cookieString;\n return true;\n }\n\n return false;\n },\n getCookie: function getCookie(name) {\n var cookieEnabled = navigator.cookieEnabled ? true : false;\n\n if (name && cookieEnabled) {\n var arr = document.cookie.match(new RegExp(\"(^| )\".concat(name, \"=([^;]*)(;|$)\")));\n\n if (arr !== null) {\n return unescape(arr[2]);\n }\n }\n\n return null;\n },\n clearCookie: function clearCookie(domain, path) {\n var keys = document.cookie.match(/[^ =;]+(?=\\=)/g);\n path = path || '/';\n\n if (keys) {\n for (var i = keys.length; i--;) {\n var cookieString = \"\".concat(keys[i], \"=0;expires=\").concat(new Date(0).toUTCString(), \";path=\").concat(path, \";\");\n\n if (domain) {\n cookieString += \"domain=\".concat(domain, \";\");\n }\n\n document.cookie = cookieString;\n }\n }\n },\n removeCookie: function removeCookie(name, domain, path) {\n var cookieEnabled = navigator.cookieEnabled ? true : false;\n\n if (name && cookieEnabled) {\n path = path || '/';\n var cookieString = \"\".concat(name, \"=0;expires=\").concat(new Date(0).toUTCString(), \";path=\").concat(path, \";\");\n\n if (domain) {\n cookieString += \"domain=\".concat(domain, \";\");\n }\n\n document.cookie = cookieString;\n return true;\n }\n\n return false;\n },\n dictMapping: function dictMapping(_ref) {\n var _this2 = this;\n\n var value = _ref.value,\n dict = _ref.dict,\n connector = _ref.connector,\n _ref$keyField = _ref.keyField,\n keyField = _ref$keyField === void 0 ? 'key' : _ref$keyField,\n _ref$titleField = _ref.titleField,\n titleField = _ref$titleField === void 0 ? 'value' : _ref$titleField;\n if (!dict || this.isNull(value)) return '';\n\n if (connector) {\n value = value.split(connector);\n }\n\n if (!this.isNull(value) && value !== '' && dict) {\n if (!this.isArray(value)) {\n value = [value];\n }\n }\n\n if (value.length <= 0) {\n return '';\n }\n\n if (this.isArray(dict)) {\n dict = this.toObject(dict, keyField);\n }\n\n return value.map(function (ele) {\n if (_this2.isObject(ele)) {\n return ele[titleField];\n }\n\n var d = dict[ele];\n\n if (_this2.isObject(d)) {\n return d[titleField];\n }\n\n return d;\n }).filter(function (ele) {\n return ele && ele !== '';\n }).join(', ');\n },\n uuid: function uuid() {\n var s4 = function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n };\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n },\n padLeft: function padLeft(str, size) {\n var s = \"00000\" + str;\n return s.substr(s.length - size);\n },\n toggleValue: function toggleValue(list, value) {\n if (!this.isArray(list)) return [value];\n var filters = list.filter(function (item) {\n return item == value;\n });\n\n if (filters.length > 0) {\n list.splice(list.indexOf(filters[0]), 1);\n } else {\n list.push(value);\n }\n },\n toSimpleArray: function toSimpleArray(data, key) {\n var r = [];\n\n if (this.isObject(data)) {\n for (var _i = 0, _Object$keys = Object.keys(data); _i < _Object$keys.length; _i++) {\n var d = _Object$keys[_i];\n r.push(data[d][key]);\n }\n }\n\n if (this.isArray(data)) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = data[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _d = _step2.value;\n r.push(_d[key]);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n\n return r;\n },\n getURLParam: function getURLParam(name, search) {\n return decodeURIComponent((new RegExp(\"[?|&]\".concat(name, \"=\") + '([^&;]+?)(&|#|;|$)').exec(search || location.search) || [true, ''])[1].replace(/\\+/g, '%20')) || null;\n },\n getAuthor: function getAuthor() {\n var author = this.getURLParam('author', window.location.search) || this.getLocal('window_author');\n\n if (author) {\n this.saveLocal('window_author', author);\n }\n\n return author;\n },\n add: function add(arg1, arg2) {\n var s1 = arg1.toString();\n var s2 = arg2.toString();\n var arg1Arr = s1.split(\".\");\n var arg2Arr = s2.split(\".\");\n var d1 = arg1Arr.length == 2 ? arg1Arr[1] : \"\";\n var d2 = arg2Arr.length == 2 ? arg2Arr[1] : \"\";\n var maxLen = Math.max(d1.length, d2.length);\n var m = Math.pow(10, maxLen);\n return Number(((s1 * m + s2 * m) / m).toFixed(maxLen));\n },\n sub: function sub(arg1, arg2) {\n return this.add(arg1, -arg2);\n },\n mul: function mul(arg1, arg2) {\n var m = 0;\n var s1 = arg1.toString();\n var s2 = arg2.toString();\n\n try {\n m += s1.split(\".\")[1].length;\n } catch (e) {}\n\n try {\n m += s2.split(\".\")[1].length;\n } catch (e) {}\n\n return Number(s1.replace(\".\", \"\")) * Number(s2.replace(\".\", \"\")) / Math.pow(10, m);\n },\n div: function div(arg1, arg2) {\n var t1 = 0;\n var t2 = 0;\n\n try {\n t1 = arg1.toString().split(\".\")[1].length;\n } catch (e) {}\n\n try {\n t2 = arg2.toString().split(\".\")[1].length;\n } catch (e) {}\n\n var r1 = Number(arg1.toString().replace(\".\", \"\"));\n var r2 = Number(arg2.toString().replace(\".\", \"\"));\n return this.mul(r1 / r2, Math.pow(10, t2 - t1));\n }\n};\nheythis.valueForKeypath = heythis.getKeyValue;\nheythis.setValueForKeypath = heythis.setKeyValue;\nvar _default = heythis;\nexports.default = _default;"},{"id":2,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/@babel/runtime/helpers/interopRequireDefault.js","name":"../hey-cli/node_modules/@babel/runtime/helpers/interopRequireDefault.js","index":2,"index2":0,"size":147,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","issuerId":1,"issuerName":"./src/index.js","issuerPath":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js"},{"id":1,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"./src/index.js"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":1,"moduleIdentifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","module":"./src/index.js","moduleName":"./src/index.js","type":"cjs require","userRequest":"@babel/runtime/helpers/interopRequireDefault","loc":"3:29-84"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":2,"source":"function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;"},{"id":3,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/@babel/runtime/helpers/typeof.js","name":"../hey-cli/node_modules/@babel/runtime/helpers/typeof.js","index":3,"index2":1,"size":817,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","issuerId":1,"issuerName":"./src/index.js","issuerPath":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js"},{"id":1,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"./src/index.js"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":1,"moduleIdentifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","module":"./src/index.js","moduleName":"./src/index.js","type":"cjs require","userRequest":"@babel/runtime/helpers/typeof","loc":"10:38-78"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":2,"source":"function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;"}],"filteredModules":0,"children":[]} | ||
{"errors":[],"warnings":[],"version":"4.30.0","hash":"7a6ac90a9db82c958941","time":1293,"builtAt":1562840829725,"publicPath":"","outputPath":"/Users/alicia/Documents/develop/github/heyui/hey-utils/build","assetsByChunkName":{"main":"utils.js"},"assets":[{"name":"utils.js","size":8973,"chunks":[0],"chunkNames":["main"],"emitted":true}],"filteredAssets":0,"entrypoints":{"main":{"chunks":[0],"assets":["utils.js"],"children":{},"childAssets":{}}},"namedChunkGroups":{"main":{"chunks":[0],"assets":["utils.js"],"children":{},"childAssets":{}}},"chunks":[{"id":0,"rendered":true,"initial":true,"entry":true,"size":16119,"names":["main"],"files":["utils.js"],"hash":"4017842fb78150184d96","siblings":[],"parents":[],"children":[],"childrenByOrder":{},"modules":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js","index":0,"index2":3,"size":28,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":null,"issuerId":null,"issuerName":null,"issuerPath":null,"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":null,"moduleIdentifier":null,"module":null,"moduleName":null,"type":"multi entry"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":0},{"id":1,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"./src/index.js","index":1,"index2":2,"size":15127,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","issuerId":0,"issuerName":"multi ./src/index.js","issuerPath":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":0,"moduleIdentifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","module":"multi ./src/index.js","moduleName":"multi ./src/index.js","type":"single entry","userRequest":"/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","loc":"main[0]"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":1,"source":"\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _typeof2 = _interopRequireDefault(require(\"@babel/runtime/helpers/typeof\"));\n\nvar heythis = {\n isObject: function isObject(input) {\n return Object.prototype.toString.call(input) === '[object Object]';\n },\n isArray: function isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n },\n isDate: function isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n },\n isNumber: function isNumber(input) {\n return input instanceof Number || Object.prototype.toString.call(input) === '[object Number]';\n },\n isString: function isString(input) {\n return input instanceof String || Object.prototype.toString.call(input) === '[object String]';\n },\n isBoolean: function isBoolean(input) {\n return typeof input == 'boolean';\n },\n isFunction: function isFunction(input) {\n return typeof input == 'function';\n },\n isNull: function isNull(input) {\n return input === undefined || input === null;\n },\n isPlainObject: function isPlainObject(obj) {\n if (obj && Object.prototype.toString.call(obj) === \"[object Object]\" && obj.constructor === Object && !hasOwnProperty.call(obj, \"constructor\")) {\n var key;\n\n for (key in obj) {}\n\n return key === undefined || hasOwnProperty.call(obj, key);\n }\n\n return false;\n },\n extend: function extend() {\n var options,\n name,\n src,\n copy,\n copyIsArray,\n clone,\n target = arguments[0] || {},\n i = 1,\n length = arguments.length,\n deep = false;\n\n if (typeof target === \"boolean\") {\n deep = target;\n target = arguments[1] || {};\n i = 2;\n }\n\n if ((0, _typeof2.default)(target) !== \"object\" && !this.isFunction(target)) {\n target = {};\n }\n\n if (length === i) {\n target = this;\n --i;\n }\n\n for (; i < length; i++) {\n if ((options = arguments[i]) != null) {\n for (name in options) {\n src = target[name];\n copy = options[name];\n\n if (src === copy) {\n continue;\n }\n\n if (deep && copy && (this.isPlainObject(copy) || (copyIsArray = this.isArray(copy)))) {\n if (copyIsArray) {\n copyIsArray = false;\n clone = src && this.isArray(src) ? src : [];\n } else {\n clone = src && this.isPlainObject(src) ? src : {};\n }\n\n target[name] = this.extend(deep, clone, copy);\n } else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n }\n\n return target;\n },\n freeze: function freeze(obj) {\n var _this = this;\n\n var that = this;\n Object.freeze(obj);\n Object.keys(obj).forEach(function (key, value) {\n if (that.isObject(obj[key])) {\n _this.freeze(obj[key]);\n }\n });\n return obj;\n },\n copy: function copy(data) {\n var copyOne = null;\n\n if (this.isObject(data)) {\n copyOne = {};\n\n for (var key in data) {\n copyOne[key] = this.copy(data[key]);\n }\n } else if (this.isArray(data)) {\n copyOne = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var index = _step.value;\n copyOne.push(this.copy(index));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } else {\n copyOne = data;\n }\n\n return copyOne;\n },\n getKeyValue: function getKeyValue(obj, keypath) {\n if (!this.isObject(obj)) {\n return null;\n }\n\n var array = null;\n\n if (this.isArray(keypath)) {\n array = keypath;\n } else if (this.isString(keypath)) {\n array = keypath.split('.');\n }\n\n if (array == null || array.length == 0) {\n return null;\n }\n\n var value = null;\n var key = array.shift();\n var keyTest = key.match(new RegExp(\"^(\\\\w+)\\\\[(\\\\d+)\\\\]$\"));\n\n if (keyTest) {\n key = keyTest[1];\n var index = keyTest[2];\n value = obj[key];\n\n if (this.isArray(value) && value.length > index) {\n value = value[index];\n }\n } else {\n value = obj[key];\n }\n\n if (array.length > 0) {\n return this.getKeyValue(value, array);\n }\n\n return value;\n },\n setKeyValue: function setKeyValue(obj, keypath, value, orignal) {\n if (!this.isObject(obj)) {\n return false;\n }\n\n var array = null;\n\n if (this.isArray(keypath)) {\n array = keypath;\n } else if (this.isString(keypath)) {\n array = keypath.split('.');\n orignal = obj;\n }\n\n if (array == null || array.length == 0) {\n return false;\n }\n\n var children = null;\n var index = 0;\n var key = array.shift();\n var keyTest = key.match(new RegExp(\"^(\\\\w+)\\\\[(\\\\d+)\\\\]$\"));\n\n if (keyTest) {\n key = keyTest[1];\n index = keyTest[2];\n children = obj[key];\n\n if (this.isArray(children) && children.length > index) {\n if (array.length > 0) {\n return this.setKeyValue(children[index], array, value, orignal);\n }\n\n children[index] = value;\n }\n } else {\n if (array.length > 0) {\n return this.setKeyValue(obj[key], array, value, orignal);\n }\n\n obj[key] = value;\n }\n\n return orignal;\n },\n toArray: function toArray(object, keyName, arg3) {\n var titleName = '';\n\n if (!this.isObject(object)) {\n return [];\n }\n\n if (this.isString(arg3)) {\n titleName = arg3;\n }\n\n var listO = [];\n\n for (var i in object) {\n var value = object[i];\n var n = {};\n\n if (this.isObject(value)) {\n n = value;\n } else {\n n[titleName] = value;\n }\n\n if (keyName) n[keyName] = i;\n listO.push(n);\n }\n\n return listO;\n },\n toObject: function toObject(list) {\n var idName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';\n var hasNum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var listO = {};\n\n for (var i = 0; i < list.length; i++) {\n var n = list[i];\n\n if (this.isObject(n)) {\n if (idName == 'count') {\n listO[i] = n;\n } else {\n listO[n[idName]] = n;\n\n if (hasNum) {\n listO[n[idName]].count = i;\n }\n }\n } else {\n listO[n] = n;\n }\n }\n\n return listO;\n },\n saveLocal: function saveLocal(name, value) {\n if (window.localStorage && JSON && name) {\n if ((0, _typeof2.default)(value) == 'object') {\n value = JSON.stringify(value);\n }\n\n window.localStorage.setItem(name, value);\n return true;\n }\n\n return false;\n },\n getLocal: function getLocal(name, type) {\n if (window.localStorage && JSON && name) {\n var data = window.localStorage.getItem(name);\n\n if (type && type == 'json' && data !== undefined) {\n try {\n return JSON.parse(data);\n } catch (e) {\n console.error(\"\\u53D6\\u6570\\u8F6C\\u6362json\\u9519\\u8BEF\".concat(e));\n return '';\n }\n } else {\n return data;\n }\n }\n\n return null;\n },\n getLocal2Json: function getLocal2Json(name) {\n if (window.localStorage && JSON && name) {\n var data = window.localStorage.getItem(name);\n\n if (!this.isNull(data)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n console.error(\"\\u53D6\\u6570\\u8F6C\\u6362json\\u9519\\u8BEF\".concat(e));\n return '';\n }\n } else {\n return data;\n }\n }\n\n return null;\n },\n removeLocal: function removeLocal(name) {\n if (window.localStorage && JSON && name) {\n window.localStorage.removeItem(name);\n }\n\n return null;\n },\n saveCookie: function saveCookie(name, value, domain, path, minSec) {\n var cookieEnabled = navigator.cookieEnabled ? true : false;\n\n if (name && cookieEnabled) {\n path = path || '/';\n\n if ((0, _typeof2.default)(value) == 'object') {\n value = JSON.stringify(value);\n }\n\n var exp;\n\n if (minSec) {\n exp = new Date(); // new Date(\"December 31, 9998\");\n\n exp.setTime(exp.getTime() + minSec * 1000);\n } else {\n exp = new Date(\"9998-01-01\");\n }\n\n var cookieString = \"\".concat(name, \"=\").concat(escape(value)).concat(minSec ? \";expires=\".concat(exp.toGMTString()) : '', \";path=\").concat(path, \";\");\n\n if (domain) {\n cookieString += \"domain=\".concat(domain, \";\");\n }\n\n document.cookie = cookieString;\n return true;\n }\n\n return false;\n },\n getCookie: function getCookie(name) {\n var cookieEnabled = navigator.cookieEnabled ? true : false;\n\n if (name && cookieEnabled) {\n var arr = document.cookie.match(new RegExp(\"(^| )\".concat(name, \"=([^;]*)(;|$)\")));\n\n if (arr !== null) {\n return unescape(arr[2]);\n }\n }\n\n return null;\n },\n clearCookie: function clearCookie(domain, path) {\n var keys = document.cookie.match(/[^ =;]+(?=\\=)/g);\n path = path || '/';\n\n if (keys) {\n for (var i = keys.length; i--;) {\n var cookieString = \"\".concat(keys[i], \"=0;expires=\").concat(new Date(0).toUTCString(), \";path=\").concat(path, \";\");\n\n if (domain) {\n cookieString += \"domain=\".concat(domain, \";\");\n }\n\n document.cookie = cookieString;\n }\n }\n },\n removeCookie: function removeCookie(name, domain, path) {\n var cookieEnabled = navigator.cookieEnabled ? true : false;\n\n if (name && cookieEnabled) {\n path = path || '/';\n var cookieString = \"\".concat(name, \"=0;expires=\").concat(new Date(0).toUTCString(), \";path=\").concat(path, \";\");\n\n if (domain) {\n cookieString += \"domain=\".concat(domain, \";\");\n }\n\n document.cookie = cookieString;\n return true;\n }\n\n return false;\n },\n dictMapping: function dictMapping(_ref) {\n var _this2 = this;\n\n var value = _ref.value,\n dict = _ref.dict,\n connector = _ref.connector,\n _ref$keyField = _ref.keyField,\n keyField = _ref$keyField === void 0 ? 'key' : _ref$keyField,\n _ref$titleField = _ref.titleField,\n titleField = _ref$titleField === void 0 ? 'value' : _ref$titleField;\n if (!dict || this.isNull(value)) return '';\n\n if (connector) {\n value = value.split(connector);\n }\n\n if (!this.isNull(value) && value !== '' && dict) {\n if (!this.isArray(value)) {\n value = [value];\n }\n }\n\n if (value.length <= 0) {\n return '';\n }\n\n if (this.isArray(dict)) {\n dict = this.toObject(dict, keyField);\n }\n\n return value.map(function (ele) {\n if (_this2.isObject(ele)) {\n return ele[titleField];\n }\n\n var d = dict[ele];\n\n if (_this2.isObject(d)) {\n return d[titleField];\n }\n\n return d;\n }).filter(function (ele) {\n return ele && ele !== '';\n }).join(', ');\n },\n uuid: function uuid() {\n var s4 = function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n };\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n },\n padLeft: function padLeft(str, size) {\n var s = \"00000\" + str;\n return s.substr(s.length - size);\n },\n toggleValue: function toggleValue(list, value) {\n if (!this.isArray(list)) return [value];\n var filters = list.filter(function (item) {\n return item == value;\n });\n\n if (filters.length > 0) {\n list.splice(list.indexOf(filters[0]), 1);\n } else {\n list.push(value);\n }\n },\n toSimpleArray: function toSimpleArray(data, key) {\n var r = [];\n\n if (this.isObject(data)) {\n for (var _i = 0, _Object$keys = Object.keys(data); _i < _Object$keys.length; _i++) {\n var d = _Object$keys[_i];\n r.push(data[d][key]);\n }\n }\n\n if (this.isArray(data)) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = data[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _d = _step2.value;\n r.push(_d[key]);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n\n return r;\n },\n getURLParam: function getURLParam(name, search) {\n return decodeURIComponent((new RegExp(\"[?|&]\".concat(name, \"=\") + '([^&;]+?)(&|#|;|$)').exec(search || location.search) || [true, ''])[1].replace(/\\+/g, '%20')) || null;\n },\n getAuthor: function getAuthor() {\n var author = this.getURLParam('author', window.location.search) || this.getLocal('window_author');\n\n if (author) {\n this.saveLocal('window_author', author);\n }\n\n return author;\n },\n add: function add(arg1, arg2) {\n var s1 = arg1.toString();\n var s2 = arg2.toString();\n var arg1Arr = s1.split(\".\");\n var arg2Arr = s2.split(\".\");\n var d1 = arg1Arr.length == 2 ? arg1Arr[1] : \"\";\n var d2 = arg2Arr.length == 2 ? arg2Arr[1] : \"\";\n var maxLen = Math.max(d1.length, d2.length);\n var m = Math.pow(10, maxLen);\n return Number(((s1 * m + s2 * m) / m).toFixed(maxLen));\n },\n sub: function sub(arg1, arg2) {\n return this.add(arg1, -arg2);\n },\n mul: function mul(arg1, arg2) {\n var m = 0;\n var s1 = arg1.toString();\n var s2 = arg2.toString();\n\n try {\n m += s1.split(\".\")[1].length;\n } catch (e) {}\n\n try {\n m += s2.split(\".\")[1].length;\n } catch (e) {}\n\n return Number(s1.replace(\".\", \"\")) * Number(s2.replace(\".\", \"\")) / Math.pow(10, m);\n },\n div: function div(arg1, arg2) {\n var t1 = 0;\n var t2 = 0;\n\n try {\n t1 = arg1.toString().split(\".\")[1].length;\n } catch (e) {}\n\n try {\n t2 = arg2.toString().split(\".\")[1].length;\n } catch (e) {}\n\n var r1 = Number(arg1.toString().replace(\".\", \"\"));\n var r2 = Number(arg2.toString().replace(\".\", \"\"));\n return this.mul(r1 / r2, Math.pow(10, t2 - t1));\n }\n};\nheythis.valueForKeypath = heythis.getKeyValue;\nheythis.setValueForKeypath = heythis.setKeyValue;\nvar _default = heythis;\nexports.default = _default;"},{"id":2,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/@babel/runtime/helpers/interopRequireDefault.js","name":"../hey-cli/node_modules/@babel/runtime/helpers/interopRequireDefault.js","index":2,"index2":0,"size":147,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","issuerId":1,"issuerName":"./src/index.js","issuerPath":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js"},{"id":1,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"./src/index.js"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":1,"moduleIdentifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","module":"./src/index.js","moduleName":"./src/index.js","type":"cjs require","userRequest":"@babel/runtime/helpers/interopRequireDefault","loc":"3:29-84"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":2,"source":"function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;"},{"id":3,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/@babel/runtime/helpers/typeof.js","name":"../hey-cli/node_modules/@babel/runtime/helpers/typeof.js","index":3,"index2":1,"size":817,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","issuerId":1,"issuerName":"./src/index.js","issuerPath":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js"},{"id":1,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"./src/index.js"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":1,"moduleIdentifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","module":"./src/index.js","moduleName":"./src/index.js","type":"cjs require","userRequest":"@babel/runtime/helpers/typeof","loc":"10:38-78"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":2,"source":"function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;"}],"filteredModules":0,"origins":[{"module":"","moduleIdentifier":"","moduleName":"","loc":"main","request":null,"reasons":[]}]}],"modules":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js","index":0,"index2":3,"size":28,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":null,"issuerId":null,"issuerName":null,"issuerPath":null,"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":null,"moduleIdentifier":null,"module":null,"moduleName":null,"type":"multi entry"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":0},{"id":1,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"./src/index.js","index":1,"index2":2,"size":15127,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","issuerId":0,"issuerName":"multi ./src/index.js","issuerPath":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":0,"moduleIdentifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","module":"multi ./src/index.js","moduleName":"multi ./src/index.js","type":"single entry","userRequest":"/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","loc":"main[0]"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":1,"source":"\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _typeof2 = _interopRequireDefault(require(\"@babel/runtime/helpers/typeof\"));\n\nvar heythis = {\n isObject: function isObject(input) {\n return Object.prototype.toString.call(input) === '[object Object]';\n },\n isArray: function isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n },\n isDate: function isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n },\n isNumber: function isNumber(input) {\n return input instanceof Number || Object.prototype.toString.call(input) === '[object Number]';\n },\n isString: function isString(input) {\n return input instanceof String || Object.prototype.toString.call(input) === '[object String]';\n },\n isBoolean: function isBoolean(input) {\n return typeof input == 'boolean';\n },\n isFunction: function isFunction(input) {\n return typeof input == 'function';\n },\n isNull: function isNull(input) {\n return input === undefined || input === null;\n },\n isPlainObject: function isPlainObject(obj) {\n if (obj && Object.prototype.toString.call(obj) === \"[object Object]\" && obj.constructor === Object && !hasOwnProperty.call(obj, \"constructor\")) {\n var key;\n\n for (key in obj) {}\n\n return key === undefined || hasOwnProperty.call(obj, key);\n }\n\n return false;\n },\n extend: function extend() {\n var options,\n name,\n src,\n copy,\n copyIsArray,\n clone,\n target = arguments[0] || {},\n i = 1,\n length = arguments.length,\n deep = false;\n\n if (typeof target === \"boolean\") {\n deep = target;\n target = arguments[1] || {};\n i = 2;\n }\n\n if ((0, _typeof2.default)(target) !== \"object\" && !this.isFunction(target)) {\n target = {};\n }\n\n if (length === i) {\n target = this;\n --i;\n }\n\n for (; i < length; i++) {\n if ((options = arguments[i]) != null) {\n for (name in options) {\n src = target[name];\n copy = options[name];\n\n if (src === copy) {\n continue;\n }\n\n if (deep && copy && (this.isPlainObject(copy) || (copyIsArray = this.isArray(copy)))) {\n if (copyIsArray) {\n copyIsArray = false;\n clone = src && this.isArray(src) ? src : [];\n } else {\n clone = src && this.isPlainObject(src) ? src : {};\n }\n\n target[name] = this.extend(deep, clone, copy);\n } else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n }\n\n return target;\n },\n freeze: function freeze(obj) {\n var _this = this;\n\n var that = this;\n Object.freeze(obj);\n Object.keys(obj).forEach(function (key, value) {\n if (that.isObject(obj[key])) {\n _this.freeze(obj[key]);\n }\n });\n return obj;\n },\n copy: function copy(data) {\n var copyOne = null;\n\n if (this.isObject(data)) {\n copyOne = {};\n\n for (var key in data) {\n copyOne[key] = this.copy(data[key]);\n }\n } else if (this.isArray(data)) {\n copyOne = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var index = _step.value;\n copyOne.push(this.copy(index));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } else {\n copyOne = data;\n }\n\n return copyOne;\n },\n getKeyValue: function getKeyValue(obj, keypath) {\n if (!this.isObject(obj)) {\n return null;\n }\n\n var array = null;\n\n if (this.isArray(keypath)) {\n array = keypath;\n } else if (this.isString(keypath)) {\n array = keypath.split('.');\n }\n\n if (array == null || array.length == 0) {\n return null;\n }\n\n var value = null;\n var key = array.shift();\n var keyTest = key.match(new RegExp(\"^(\\\\w+)\\\\[(\\\\d+)\\\\]$\"));\n\n if (keyTest) {\n key = keyTest[1];\n var index = keyTest[2];\n value = obj[key];\n\n if (this.isArray(value) && value.length > index) {\n value = value[index];\n }\n } else {\n value = obj[key];\n }\n\n if (array.length > 0) {\n return this.getKeyValue(value, array);\n }\n\n return value;\n },\n setKeyValue: function setKeyValue(obj, keypath, value, orignal) {\n if (!this.isObject(obj)) {\n return false;\n }\n\n var array = null;\n\n if (this.isArray(keypath)) {\n array = keypath;\n } else if (this.isString(keypath)) {\n array = keypath.split('.');\n orignal = obj;\n }\n\n if (array == null || array.length == 0) {\n return false;\n }\n\n var children = null;\n var index = 0;\n var key = array.shift();\n var keyTest = key.match(new RegExp(\"^(\\\\w+)\\\\[(\\\\d+)\\\\]$\"));\n\n if (keyTest) {\n key = keyTest[1];\n index = keyTest[2];\n children = obj[key];\n\n if (this.isArray(children) && children.length > index) {\n if (array.length > 0) {\n return this.setKeyValue(children[index], array, value, orignal);\n }\n\n children[index] = value;\n }\n } else {\n if (array.length > 0) {\n return this.setKeyValue(obj[key], array, value, orignal);\n }\n\n obj[key] = value;\n }\n\n return orignal;\n },\n toArray: function toArray(object, keyName, arg3) {\n var titleName = '';\n\n if (!this.isObject(object)) {\n return [];\n }\n\n if (this.isString(arg3)) {\n titleName = arg3;\n }\n\n var listO = [];\n\n for (var i in object) {\n var value = object[i];\n var n = {};\n\n if (this.isObject(value)) {\n n = value;\n } else {\n n[titleName] = value;\n }\n\n if (keyName) n[keyName] = i;\n listO.push(n);\n }\n\n return listO;\n },\n toObject: function toObject(list) {\n var idName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';\n var hasNum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var listO = {};\n\n for (var i = 0; i < list.length; i++) {\n var n = list[i];\n\n if (this.isObject(n)) {\n if (idName == 'count') {\n listO[i] = n;\n } else {\n listO[n[idName]] = n;\n\n if (hasNum) {\n listO[n[idName]].count = i;\n }\n }\n } else {\n listO[n] = n;\n }\n }\n\n return listO;\n },\n saveLocal: function saveLocal(name, value) {\n if (window.localStorage && JSON && name) {\n if ((0, _typeof2.default)(value) == 'object') {\n value = JSON.stringify(value);\n }\n\n window.localStorage.setItem(name, value);\n return true;\n }\n\n return false;\n },\n getLocal: function getLocal(name, type) {\n if (window.localStorage && JSON && name) {\n var data = window.localStorage.getItem(name);\n\n if (type && type == 'json' && data !== undefined) {\n try {\n return JSON.parse(data);\n } catch (e) {\n console.error(\"\\u53D6\\u6570\\u8F6C\\u6362json\\u9519\\u8BEF\".concat(e));\n return '';\n }\n } else {\n return data;\n }\n }\n\n return null;\n },\n getLocal2Json: function getLocal2Json(name) {\n if (window.localStorage && JSON && name) {\n var data = window.localStorage.getItem(name);\n\n if (!this.isNull(data)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n console.error(\"\\u53D6\\u6570\\u8F6C\\u6362json\\u9519\\u8BEF\".concat(e));\n return '';\n }\n } else {\n return data;\n }\n }\n\n return null;\n },\n removeLocal: function removeLocal(name) {\n if (window.localStorage && JSON && name) {\n window.localStorage.removeItem(name);\n }\n\n return null;\n },\n saveCookie: function saveCookie(name, value, domain, path, minSec) {\n var cookieEnabled = navigator.cookieEnabled ? true : false;\n\n if (name && cookieEnabled) {\n path = path || '/';\n\n if ((0, _typeof2.default)(value) == 'object') {\n value = JSON.stringify(value);\n }\n\n var exp;\n\n if (minSec) {\n exp = new Date(); // new Date(\"December 31, 9998\");\n\n exp.setTime(exp.getTime() + minSec * 1000);\n } else {\n exp = new Date(\"9998-01-01\");\n }\n\n var cookieString = \"\".concat(name, \"=\").concat(escape(value)).concat(minSec ? \";expires=\".concat(exp.toGMTString()) : '', \";path=\").concat(path, \";\");\n\n if (domain) {\n cookieString += \"domain=\".concat(domain, \";\");\n }\n\n document.cookie = cookieString;\n return true;\n }\n\n return false;\n },\n getCookie: function getCookie(name) {\n var cookieEnabled = navigator.cookieEnabled ? true : false;\n\n if (name && cookieEnabled) {\n var arr = document.cookie.match(new RegExp(\"(^| )\".concat(name, \"=([^;]*)(;|$)\")));\n\n if (arr !== null) {\n return unescape(arr[2]);\n }\n }\n\n return null;\n },\n clearCookie: function clearCookie(domain, path) {\n var keys = document.cookie.match(/[^ =;]+(?=\\=)/g);\n path = path || '/';\n\n if (keys) {\n for (var i = keys.length; i--;) {\n var cookieString = \"\".concat(keys[i], \"=0;expires=\").concat(new Date(0).toUTCString(), \";path=\").concat(path, \";\");\n\n if (domain) {\n cookieString += \"domain=\".concat(domain, \";\");\n }\n\n document.cookie = cookieString;\n }\n }\n },\n removeCookie: function removeCookie(name, domain, path) {\n var cookieEnabled = navigator.cookieEnabled ? true : false;\n\n if (name && cookieEnabled) {\n path = path || '/';\n var cookieString = \"\".concat(name, \"=0;expires=\").concat(new Date(0).toUTCString(), \";path=\").concat(path, \";\");\n\n if (domain) {\n cookieString += \"domain=\".concat(domain, \";\");\n }\n\n document.cookie = cookieString;\n return true;\n }\n\n return false;\n },\n dictMapping: function dictMapping(_ref) {\n var _this2 = this;\n\n var value = _ref.value,\n dict = _ref.dict,\n connector = _ref.connector,\n _ref$keyField = _ref.keyField,\n keyField = _ref$keyField === void 0 ? 'key' : _ref$keyField,\n _ref$titleField = _ref.titleField,\n titleField = _ref$titleField === void 0 ? 'value' : _ref$titleField;\n if (!dict || this.isNull(value)) return '';\n\n if (connector) {\n value = value.split(connector);\n }\n\n if (!this.isNull(value) && value !== '' && dict) {\n if (!this.isArray(value)) {\n value = [value];\n }\n }\n\n if (value.length <= 0) {\n return '';\n }\n\n if (this.isArray(dict)) {\n dict = this.toObject(dict, keyField);\n }\n\n return value.map(function (ele) {\n if (_this2.isObject(ele)) {\n return ele[titleField];\n }\n\n var d = dict[ele];\n\n if (_this2.isObject(d)) {\n return d[titleField];\n }\n\n return d;\n }).filter(function (ele) {\n return ele && ele !== '';\n }).join(', ');\n },\n uuid: function uuid() {\n var s4 = function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n };\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n },\n padLeft: function padLeft(str, size) {\n var s = \"00000\" + str;\n return s.substr(s.length - size);\n },\n toggleValue: function toggleValue(list, value) {\n if (!this.isArray(list)) return [value];\n var filters = list.filter(function (item) {\n return item == value;\n });\n\n if (filters.length > 0) {\n list.splice(list.indexOf(filters[0]), 1);\n } else {\n list.push(value);\n }\n },\n toSimpleArray: function toSimpleArray(data, key) {\n var r = [];\n\n if (this.isObject(data)) {\n for (var _i = 0, _Object$keys = Object.keys(data); _i < _Object$keys.length; _i++) {\n var d = _Object$keys[_i];\n r.push(data[d][key]);\n }\n }\n\n if (this.isArray(data)) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = data[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _d = _step2.value;\n r.push(_d[key]);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n\n return r;\n },\n getURLParam: function getURLParam(name, search) {\n return decodeURIComponent((new RegExp(\"[?|&]\".concat(name, \"=\") + '([^&;]+?)(&|#|;|$)').exec(search || location.search) || [true, ''])[1].replace(/\\+/g, '%20')) || null;\n },\n getAuthor: function getAuthor() {\n var author = this.getURLParam('author', window.location.search) || this.getLocal('window_author');\n\n if (author) {\n this.saveLocal('window_author', author);\n }\n\n return author;\n },\n add: function add(arg1, arg2) {\n var s1 = arg1.toString();\n var s2 = arg2.toString();\n var arg1Arr = s1.split(\".\");\n var arg2Arr = s2.split(\".\");\n var d1 = arg1Arr.length == 2 ? arg1Arr[1] : \"\";\n var d2 = arg2Arr.length == 2 ? arg2Arr[1] : \"\";\n var maxLen = Math.max(d1.length, d2.length);\n var m = Math.pow(10, maxLen);\n return Number(((s1 * m + s2 * m) / m).toFixed(maxLen));\n },\n sub: function sub(arg1, arg2) {\n return this.add(arg1, -arg2);\n },\n mul: function mul(arg1, arg2) {\n var m = 0;\n var s1 = arg1.toString();\n var s2 = arg2.toString();\n\n try {\n m += s1.split(\".\")[1].length;\n } catch (e) {}\n\n try {\n m += s2.split(\".\")[1].length;\n } catch (e) {}\n\n return Number(s1.replace(\".\", \"\")) * Number(s2.replace(\".\", \"\")) / Math.pow(10, m);\n },\n div: function div(arg1, arg2) {\n var t1 = 0;\n var t2 = 0;\n\n try {\n t1 = arg1.toString().split(\".\")[1].length;\n } catch (e) {}\n\n try {\n t2 = arg2.toString().split(\".\")[1].length;\n } catch (e) {}\n\n var r1 = Number(arg1.toString().replace(\".\", \"\"));\n var r2 = Number(arg2.toString().replace(\".\", \"\"));\n return this.mul(r1 / r2, Math.pow(10, t2 - t1));\n }\n};\nheythis.valueForKeypath = heythis.getKeyValue;\nheythis.setValueForKeypath = heythis.setKeyValue;\nvar _default = heythis;\nexports.default = _default;"},{"id":2,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/@babel/runtime/helpers/interopRequireDefault.js","name":"../hey-cli/node_modules/@babel/runtime/helpers/interopRequireDefault.js","index":2,"index2":0,"size":147,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","issuerId":1,"issuerName":"./src/index.js","issuerPath":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js"},{"id":1,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"./src/index.js"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":1,"moduleIdentifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","module":"./src/index.js","moduleName":"./src/index.js","type":"cjs require","userRequest":"@babel/runtime/helpers/interopRequireDefault","loc":"3:29-84"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":2,"source":"function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;"},{"id":3,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/@babel/runtime/helpers/typeof.js","name":"../hey-cli/node_modules/@babel/runtime/helpers/typeof.js","index":3,"index2":1,"size":817,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":[0],"issuer":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","issuerId":1,"issuerName":"./src/index.js","issuerPath":[{"id":0,"identifier":"multi /Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"multi ./src/index.js"},{"id":1,"identifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","name":"./src/index.js"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":1,"moduleIdentifier":"/Users/alicia/Documents/develop/github/heyui/hey-cli/node_modules/babel-loader/lib/index.js??ref--5-0!/Users/alicia/Documents/develop/github/heyui/hey-utils/src/index.js","module":"./src/index.js","moduleName":"./src/index.js","type":"cjs require","userRequest":"@babel/runtime/helpers/typeof","loc":"10:38-78"}],"usedExports":true,"providedExports":null,"optimizationBailout":["ModuleConcatenation bailout: Module is not an ECMAScript module"],"depth":2,"source":"function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;"}],"filteredModules":0,"children":[]} |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Utils",[],e):"object"==typeof exports?exports.Utils=e():t.Utils=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";var r=n(2);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r(n(3)),i={isObject:function(t){return"[object Object]"===Object.prototype.toString.call(t)},isArray:function(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)},isDate:function(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)},isNumber:function(t){return t instanceof Number||"[object Number]"===Object.prototype.toString.call(t)},isString:function(t){return t instanceof String||"[object String]"===Object.prototype.toString.call(t)},isBoolean:function(t){return"boolean"==typeof t},isFunction:function(t){return"function"==typeof t},isNull:function(t){return null==t},isPlainObject:function(t){if(t&&"[object Object]"===Object.prototype.toString.call(t)&&t.constructor===Object&&!hasOwnProperty.call(t,"constructor")){var e;for(e in t);return void 0===e||hasOwnProperty.call(t,e)}return!1},extend:function(){var t,e,n,r,i,c,a=arguments[0]||{},u=1,l=arguments.length,s=!1;for("boolean"==typeof a&&(s=a,a=arguments[1]||{},u=2),"object"===(0,o.default)(a)||this.isFunction(a)||(a={}),l===u&&(a=this,--u);u<l;u++)if(null!=(t=arguments[u]))for(e in t)(n=a[e])!==(r=t[e])&&(s&&r&&(this.isPlainObject(r)||(i=this.isArray(r)))?(i?(i=!1,c=n&&this.isArray(n)?n:[]):c=n&&this.isPlainObject(n)?n:{},a[e]=this.extend(s,c,r)):void 0!==r&&(a[e]=r));return a},freeze:function(t){var e=this,n=this;return Object.freeze(t),Object.keys(t).forEach(function(r,o){n.isObject(t[r])&&e.freeze(t[r])}),t},copy:function(t){var e=null;if(this.isObject(t))for(var n in e={},t)e[n]=this.copy(t[n]);else if(this.isArray(t)){e=[];var r=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(r=(c=a.next()).done);r=!0){var u=c.value;e.push(this.copy(u))}}catch(t){o=!0,i=t}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}}else e=t;return e},getKeyValue:function(t,e){if(!this.isObject(t))return null;var n=null;if(this.isArray(e)?n=e:this.isString(e)&&(n=e.split(".")),null==n||0==n.length)return null;var r=null,o=n.shift(),i=o.match(new RegExp("^(\\w+)\\[(\\d+)\\]$"));if(i){o=i[1];var c=i[2];r=t[o],this.isArray(r)&&r.length>c&&(r=r[c])}else r=t[o];return n.length>0?this.getKeyValue(r,n):r},setKeyValue:function(t,e,n,r){if(!this.isObject(t))return!1;var o=null;if(this.isArray(e)?o=e:this.isString(e)&&(o=e.split("."),r=t),null==o||0==o.length)return!1;var i=null,c=0,a=o.shift(),u=a.match(new RegExp("^(\\w+)\\[(\\d+)\\]$"));if(u){if(a=u[1],c=u[2],i=t[a],this.isArray(i)&&i.length>c){if(o.length>0)return this.setKeyValue(i[c],o,n,r);i[c]=n}}else{if(o.length>0)return this.setKeyValue(t[a],o,n,r);t[a]=n}return r},toArray:function(t,e,n){var r="";if(!this.isObject(t))return[];this.isString(n)&&(r=n);var o=[];for(var i in t){var c=t[i],a={};this.isObject(c)?a=c:a[r]=c,e&&(a[e]=i),o.push(a)}return o},toObject:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r={},o=0;o<t.length;o++){var i=t[o];this.isObject(i)?"count"==e?r[o]=i:(r[i[e]]=i,n&&(r[i[e]].count=o)):r[i]=i}return r},saveLocal:function(t,e){return!!(window.localStorage&&JSON&&t)&&("object"==(0,o.default)(e)&&(e=JSON.stringify(e)),window.localStorage.setItem("name",e),!0)},getLocal:function(t,e){if(window.localStorage&&JSON&&t){var n=window.localStorage.getItem(t);if(!e||"json"!=e||void 0===n)return n;try{return JSON.parse(n)}catch(t){return console.error("取数转换json错误".concat(t)),""}}return null},getLocal2Json:function(t){if(window.localStorage&&JSON&&t){var e=window.localStorage.getItem(t);if(this.isNull(e))return e;try{return JSON.parse(e)}catch(t){return console.error("取数转换json错误".concat(t)),""}}return null},removeLocal:function(t){return window.localStorage&&JSON&&t&&window.localStorage.removeItem(t),null},saveCookie:function(t,e,n,r,i){var c=!!navigator.cookieEnabled;if(t&&c){var a;r=r||"/","object"==(0,o.default)(e)&&(e=JSON.stringify(e)),i?(a=new Date).setTime(a.getTime()+1e3*i):a=new Date("9998-01-01");var u="".concat(t,"=").concat(escape(e)).concat(i?";expires=".concat(a.toGMTString()):"",";path=").concat(r,";");return n&&(u+="domain=".concat(n,";")),document.cookie=u,!0}return!1},getCookie:function(t){var e=!!navigator.cookieEnabled;if(t&&e){var n=document.cookie.match(new RegExp("(^| )".concat(t,"=([^;]*)(;|$)")));if(null!==n)return unescape(n[2])}return null},clearCookie:function(t,e){var n=document.cookie.match(/[^ =;]+(?=\=)/g);if(e=e||"/",n)for(var r=n.length;r--;){var o="".concat(n[r],"=0;expires=").concat(new Date(0).toUTCString(),";path=").concat(e,";");t&&(o+="domain=".concat(t,";")),document.cookie=o}},removeCookie:function(t,e,n){var r=!!navigator.cookieEnabled;if(t&&r){n=n||"/";var o="".concat(t,"=0;expires=").concat(new Date(0).toUTCString(),";path=").concat(n,";");return e&&(o+="domain=".concat(e,";")),document.cookie=o,!0}return!1},dictMapping:function(t){var e=this,n=t.value,r=t.dict,o=t.connector,i=t.keyField,c=void 0===i?"key":i,a=t.titleField,u=void 0===a?"value":a;return!r||this.isNull(n)?"":(o&&(n=n.split(o)),!this.isNull(n)&&""!==n&&r&&(this.isArray(n)||(n=[n])),n.length<=0?"":(this.isArray(r)&&(r=this.toObject(r,c)),n.map(function(t){if(e.isObject(t))return t[u];var n=r[t];return e.isObject(n)?n[u]:n}).filter(function(t){return t&&""!==t}).join(", ")))},uuid:function(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},padLeft:function(t,e){var n="00000"+t;return n.substr(n.length-e)},toggleValue:function(t,e){if(!this.isArray(t))return[e];var n=t.filter(function(t){return t==e});n.length>0?t.splice(t.indexOf(n[0]),1):t.push(e)},toSimpleArray:function(t,e){var n=[];if(this.isObject(t))for(var r=0,o=Object.keys(t);r<o.length;r++){var i=o[r];n.push(t[i][e])}if(this.isArray(t)){var c=!0,a=!1,u=void 0;try{for(var l,s=t[Symbol.iterator]();!(c=(l=s.next()).done);c=!0){var f=l.value;n.push(f[e])}}catch(t){a=!0,u=t}finally{try{c||null==s.return||s.return()}finally{if(a)throw u}}}return n},getURLParam:function(t,e){return decodeURIComponent((new RegExp("[?|&]".concat(t,"=")+"([^&;]+?)(&|#|;|$)").exec(e||location.search)||[!0,""])[1].replace(/\+/g,"%20"))||null},getAuthor:function(){var t=this.getURLParam("author",window.location.search)||this.getLocal("window_author");return t&&this.saveLocal("window_author",t),t},add:function(t,e){var n=t.toString(),r=e.toString(),o=n.split("."),i=r.split("."),c=2==o.length?o[1]:"",a=2==i.length?i[1]:"",u=Math.max(c.length,a.length),l=Math.pow(10,u);return Number(((n*l+r*l)/l).toFixed(u))},sub:function(t,e){return this.add(t,-e)},mul:function(t,e){var n=0,r=t.toString(),o=e.toString();try{n+=r.split(".")[1].length}catch(t){}try{n+=o.split(".")[1].length}catch(t){}return Number(r.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,n)},div:function(t,e){var n=0,r=0;try{n=t.toString().split(".")[1].length}catch(t){}try{r=e.toString().split(".")[1].length}catch(t){}var o=Number(t.toString().replace(".","")),i=Number(e.toString().replace(".",""));return this.mul(o/i,Math.pow(10,r-n))}};i.valueForKeypath=i.getKeyValue,i.setValueForKeypath=i.setKeyValue;var c=i;e.default=c},function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r}]).default}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Utils",[],e):"object"==typeof exports?exports.Utils=e():t.Utils=e()}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){t.exports=r(1)},function(t,e,r){"use strict";var n=r(2);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(r(3)),i={isObject:function(t){return"[object Object]"===Object.prototype.toString.call(t)},isArray:function(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)},isDate:function(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)},isNumber:function(t){return t instanceof Number||"[object Number]"===Object.prototype.toString.call(t)},isString:function(t){return t instanceof String||"[object String]"===Object.prototype.toString.call(t)},isBoolean:function(t){return"boolean"==typeof t},isFunction:function(t){return"function"==typeof t},isNull:function(t){return null==t},isPlainObject:function(t){if(t&&"[object Object]"===Object.prototype.toString.call(t)&&t.constructor===Object&&!hasOwnProperty.call(t,"constructor")){var e;for(e in t);return void 0===e||hasOwnProperty.call(t,e)}return!1},extend:function(){var t,e,r,n,i,c,a=arguments[0]||{},u=1,l=arguments.length,s=!1;for("boolean"==typeof a&&(s=a,a=arguments[1]||{},u=2),"object"===(0,o.default)(a)||this.isFunction(a)||(a={}),l===u&&(a=this,--u);u<l;u++)if(null!=(t=arguments[u]))for(e in t)(r=a[e])!==(n=t[e])&&(s&&n&&(this.isPlainObject(n)||(i=this.isArray(n)))?(i?(i=!1,c=r&&this.isArray(r)?r:[]):c=r&&this.isPlainObject(r)?r:{},a[e]=this.extend(s,c,n)):void 0!==n&&(a[e]=n));return a},freeze:function(t){var e=this,r=this;return Object.freeze(t),Object.keys(t).forEach(function(n,o){r.isObject(t[n])&&e.freeze(t[n])}),t},copy:function(t){var e=null;if(this.isObject(t))for(var r in e={},t)e[r]=this.copy(t[r]);else if(this.isArray(t)){e=[];var n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done);n=!0){var u=c.value;e.push(this.copy(u))}}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}}else e=t;return e},getKeyValue:function(t,e){if(!this.isObject(t))return null;var r=null;if(this.isArray(e)?r=e:this.isString(e)&&(r=e.split(".")),null==r||0==r.length)return null;var n=null,o=r.shift(),i=o.match(new RegExp("^(\\w+)\\[(\\d+)\\]$"));if(i){o=i[1];var c=i[2];n=t[o],this.isArray(n)&&n.length>c&&(n=n[c])}else n=t[o];return r.length>0?this.getKeyValue(n,r):n},setKeyValue:function(t,e,r,n){if(!this.isObject(t))return!1;var o=null;if(this.isArray(e)?o=e:this.isString(e)&&(o=e.split("."),n=t),null==o||0==o.length)return!1;var i=null,c=0,a=o.shift(),u=a.match(new RegExp("^(\\w+)\\[(\\d+)\\]$"));if(u){if(a=u[1],c=u[2],i=t[a],this.isArray(i)&&i.length>c){if(o.length>0)return this.setKeyValue(i[c],o,r,n);i[c]=r}}else{if(o.length>0)return this.setKeyValue(t[a],o,r,n);t[a]=r}return n},toArray:function(t,e,r){var n="";if(!this.isObject(t))return[];this.isString(r)&&(n=r);var o=[];for(var i in t){var c=t[i],a={};this.isObject(c)?a=c:a[n]=c,e&&(a[e]=i),o.push(a)}return o},toObject:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n={},o=0;o<t.length;o++){var i=t[o];this.isObject(i)?"count"==e?n[o]=i:(n[i[e]]=i,r&&(n[i[e]].count=o)):n[i]=i}return n},saveLocal:function(t,e){return!!(window.localStorage&&JSON&&t)&&("object"==(0,o.default)(e)&&(e=JSON.stringify(e)),window.localStorage.setItem(t,e),!0)},getLocal:function(t,e){if(window.localStorage&&JSON&&t){var r=window.localStorage.getItem(t);if(!e||"json"!=e||void 0===r)return r;try{return JSON.parse(r)}catch(t){return console.error("取数转换json错误".concat(t)),""}}return null},getLocal2Json:function(t){if(window.localStorage&&JSON&&t){var e=window.localStorage.getItem(t);if(this.isNull(e))return e;try{return JSON.parse(e)}catch(t){return console.error("取数转换json错误".concat(t)),""}}return null},removeLocal:function(t){return window.localStorage&&JSON&&t&&window.localStorage.removeItem(t),null},saveCookie:function(t,e,r,n,i){var c=!!navigator.cookieEnabled;if(t&&c){var a;n=n||"/","object"==(0,o.default)(e)&&(e=JSON.stringify(e)),i?(a=new Date).setTime(a.getTime()+1e3*i):a=new Date("9998-01-01");var u="".concat(t,"=").concat(escape(e)).concat(i?";expires=".concat(a.toGMTString()):"",";path=").concat(n,";");return r&&(u+="domain=".concat(r,";")),document.cookie=u,!0}return!1},getCookie:function(t){var e=!!navigator.cookieEnabled;if(t&&e){var r=document.cookie.match(new RegExp("(^| )".concat(t,"=([^;]*)(;|$)")));if(null!==r)return unescape(r[2])}return null},clearCookie:function(t,e){var r=document.cookie.match(/[^ =;]+(?=\=)/g);if(e=e||"/",r)for(var n=r.length;n--;){var o="".concat(r[n],"=0;expires=").concat(new Date(0).toUTCString(),";path=").concat(e,";");t&&(o+="domain=".concat(t,";")),document.cookie=o}},removeCookie:function(t,e,r){var n=!!navigator.cookieEnabled;if(t&&n){r=r||"/";var o="".concat(t,"=0;expires=").concat(new Date(0).toUTCString(),";path=").concat(r,";");return e&&(o+="domain=".concat(e,";")),document.cookie=o,!0}return!1},dictMapping:function(t){var e=this,r=t.value,n=t.dict,o=t.connector,i=t.keyField,c=void 0===i?"key":i,a=t.titleField,u=void 0===a?"value":a;return!n||this.isNull(r)?"":(o&&(r=r.split(o)),!this.isNull(r)&&""!==r&&n&&(this.isArray(r)||(r=[r])),r.length<=0?"":(this.isArray(n)&&(n=this.toObject(n,c)),r.map(function(t){if(e.isObject(t))return t[u];var r=n[t];return e.isObject(r)?r[u]:r}).filter(function(t){return t&&""!==t}).join(", ")))},uuid:function(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},padLeft:function(t,e){var r="00000"+t;return r.substr(r.length-e)},toggleValue:function(t,e){if(!this.isArray(t))return[e];var r=t.filter(function(t){return t==e});r.length>0?t.splice(t.indexOf(r[0]),1):t.push(e)},toSimpleArray:function(t,e){var r=[];if(this.isObject(t))for(var n=0,o=Object.keys(t);n<o.length;n++){var i=o[n];r.push(t[i][e])}if(this.isArray(t)){var c=!0,a=!1,u=void 0;try{for(var l,s=t[Symbol.iterator]();!(c=(l=s.next()).done);c=!0){var f=l.value;r.push(f[e])}}catch(t){a=!0,u=t}finally{try{c||null==s.return||s.return()}finally{if(a)throw u}}}return r},getURLParam:function(t,e){return decodeURIComponent((new RegExp("[?|&]".concat(t,"=")+"([^&;]+?)(&|#|;|$)").exec(e||location.search)||[!0,""])[1].replace(/\+/g,"%20"))||null},getAuthor:function(){var t=this.getURLParam("author",window.location.search)||this.getLocal("window_author");return t&&this.saveLocal("window_author",t),t},add:function(t,e){var r=t.toString(),n=e.toString(),o=r.split("."),i=n.split("."),c=2==o.length?o[1]:"",a=2==i.length?i[1]:"",u=Math.max(c.length,a.length),l=Math.pow(10,u);return Number(((r*l+n*l)/l).toFixed(u))},sub:function(t,e){return this.add(t,-e)},mul:function(t,e){var r=0,n=t.toString(),o=e.toString();try{r+=n.split(".")[1].length}catch(t){}try{r+=o.split(".")[1].length}catch(t){}return Number(n.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,r)},div:function(t,e){var r=0,n=0;try{r=t.toString().split(".")[1].length}catch(t){}try{n=e.toString().split(".")[1].length}catch(t){}var o=Number(t.toString().replace(".","")),i=Number(e.toString().replace(".",""));return this.mul(o/i,Math.pow(10,n-r))}};i.valueForKeypath=i.getKeyValue,i.setValueForKeypath=i.setKeyValue;var c=i;e.default=c},function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}}},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(e){return"function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},n(e)}t.exports=n}]).default}); |
{ | ||
"name": "hey-utils", | ||
"version": "1.0.1-alpha.0", | ||
"version": "1.0.1-alpha.1", | ||
"description": "js-utils, js, util", | ||
@@ -5,0 +5,0 @@ "main": "build/utils.js", |
@@ -218,3 +218,3 @@ | ||
} | ||
window.localStorage.setItem('name', value); | ||
window.localStorage.setItem(name, value); | ||
return true; | ||
@@ -221,0 +221,0 @@ } |
86243