utils-lib-js 2.0.14 → 2.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,7 @@ export declare const stringToJson: IStringToJson;
14
14
  export declare const jsonToString: IJsonToString;
15
15
  export declare const isWindow: (win: any) => boolean;
16
16
  export declare const emptyObject: (init?: IObject<unknown>) => any;
17
+ export declare const isEmptyObject: (object?: IObject<unknown>) => boolean;
17
18
  declare const _default: {
18
19
  getValue: IGetValue;
19
20
  setValue: ISetValue;
@@ -5,11 +5,13 @@ export declare const urlSplit: IUrlSplit;
5
5
  export declare const urlJoin: IUrlJoin;
6
6
  export declare const getType: IGetType<types>;
7
7
  export declare const getTypeByList: IGetTypeByList;
8
+ export declare const toKebabCase: (camelCase: string, separator?: string) => string;
8
9
  declare const _default: {
9
10
  randomNum: IRandomNum;
10
11
  urlSplit: IUrlSplit;
11
12
  urlJoin: IUrlJoin;
12
13
  getType: IGetType<types>;
13
14
  getTypeByList: IGetTypeByList;
15
+ toKebabCase: (camelCase: string, separator?: string) => string;
14
16
  };
15
17
  export default _default;
@@ -52,6 +52,7 @@ declare const _default: {
52
52
  urlJoin: import("./types").IUrlJoin;
53
53
  getType: import("./types").IGetType<import("./static").types>;
54
54
  getTypeByList: import("./types").IGetTypeByList;
55
+ toKebabCase: (camelCase: string, separator?: string) => string;
55
56
  getValue: import("./types").IGetValue;
56
57
  setValue: import("./types").ISetValue;
57
58
  mixIn: import("./types").IMixIn;
package/dist/cjs/index.js CHANGED
@@ -97,12 +97,17 @@ var getTypeByList$5 = function (data, whiteList) {
97
97
  var __type = getType$5(data);
98
98
  return whiteList.indexOf(__type) > 0;
99
99
  };
100
+ var toKebabCase = function (camelCase, separator) {
101
+ if (separator === void 0) { separator = "-"; }
102
+ return camelCase.replace(/[A-Z]/g, function (m) { return "".concat(separator).concat(m.toLowerCase()); });
103
+ };
100
104
  var base$5 = {
101
105
  randomNum: randomNum$5,
102
106
  urlSplit: urlSplit$5,
103
107
  urlJoin: urlJoin$5,
104
108
  getType: getType$5,
105
109
  getTypeByList: getTypeByList$5,
110
+ toKebabCase: toKebabCase,
106
111
  };
107
112
 
108
113
  var getValue$5 = function (object, key, defaultValue) {
@@ -263,6 +268,11 @@ var emptyObject$1 = function (init) {
263
268
  Reflect.ownKeys(init).forEach(function (k) { return _o[k] = init[k]; });
264
269
  return _o;
265
270
  };
271
+ var isEmptyObject = function (object) {
272
+ if (object === void 0) { object = {}; }
273
+ var oo = emptyObject$1(object);
274
+ return Reflect.ownKeys(oo).length <= 0;
275
+ };
266
276
  var object$5 = {
267
277
  getValue: getValue$5,
268
278
  setValue: setValue$5,
@@ -12197,6 +12207,7 @@ exports.getType = getType$5;
12197
12207
  exports.getTypeByList = getTypeByList$5;
12198
12208
  exports.getValue = getValue$5;
12199
12209
  exports.inherit = inherit$5;
12210
+ exports.isEmptyObject = isEmptyObject;
12200
12211
  exports.isNotObject = isNotObject$5;
12201
12212
  exports.isWindow = isWindow$5;
12202
12213
  exports.jsonToString = jsonToString$5;
@@ -12214,5 +12225,6 @@ exports.stopBubble = stopBubble$5;
12214
12225
  exports.stopDefault = stopDefault$5;
12215
12226
  exports.stringToJson = stringToJson$5;
12216
12227
  exports.throttle = throttle$5;
12228
+ exports.toKebabCase = toKebabCase;
12217
12229
  exports.urlJoin = urlJoin$5;
12218
12230
  exports.urlSplit = urlSplit$5;
@@ -14,6 +14,7 @@ export declare const stringToJson: IStringToJson;
14
14
  export declare const jsonToString: IJsonToString;
15
15
  export declare const isWindow: (win: any) => boolean;
16
16
  export declare const emptyObject: (init?: IObject<unknown>) => any;
17
+ export declare const isEmptyObject: (object?: IObject<unknown>) => boolean;
17
18
  declare const _default: {
18
19
  getValue: IGetValue;
19
20
  setValue: ISetValue;
@@ -5,11 +5,13 @@ export declare const urlSplit: IUrlSplit;
5
5
  export declare const urlJoin: IUrlJoin;
6
6
  export declare const getType: IGetType<types>;
7
7
  export declare const getTypeByList: IGetTypeByList;
8
+ export declare const toKebabCase: (camelCase: string, separator?: string) => string;
8
9
  declare const _default: {
9
10
  randomNum: IRandomNum;
10
11
  urlSplit: IUrlSplit;
11
12
  urlJoin: IUrlJoin;
12
13
  getType: IGetType<types>;
13
14
  getTypeByList: IGetTypeByList;
15
+ toKebabCase: (camelCase: string, separator?: string) => string;
14
16
  };
15
17
  export default _default;
@@ -52,6 +52,7 @@ declare const _default: {
52
52
  urlJoin: import("./types").IUrlJoin;
53
53
  getType: import("./types").IGetType<import("./static").types>;
54
54
  getTypeByList: import("./types").IGetTypeByList;
55
+ toKebabCase: (camelCase: string, separator?: string) => string;
55
56
  getValue: import("./types").IGetValue;
56
57
  setValue: import("./types").ISetValue;
57
58
  mixIn: import("./types").IMixIn;
package/dist/esm/index.js CHANGED
@@ -93,12 +93,17 @@ var getTypeByList$5 = function (data, whiteList) {
93
93
  var __type = getType$5(data);
94
94
  return whiteList.indexOf(__type) > 0;
95
95
  };
96
+ var toKebabCase = function (camelCase, separator) {
97
+ if (separator === void 0) { separator = "-"; }
98
+ return camelCase.replace(/[A-Z]/g, function (m) { return "".concat(separator).concat(m.toLowerCase()); });
99
+ };
96
100
  var base$5 = {
97
101
  randomNum: randomNum$5,
98
102
  urlSplit: urlSplit$5,
99
103
  urlJoin: urlJoin$5,
100
104
  getType: getType$5,
101
105
  getTypeByList: getTypeByList$5,
106
+ toKebabCase: toKebabCase,
102
107
  };
103
108
 
104
109
  var getValue$5 = function (object, key, defaultValue) {
@@ -259,6 +264,11 @@ var emptyObject$1 = function (init) {
259
264
  Reflect.ownKeys(init).forEach(function (k) { return _o[k] = init[k]; });
260
265
  return _o;
261
266
  };
267
+ var isEmptyObject = function (object) {
268
+ if (object === void 0) { object = {}; }
269
+ var oo = emptyObject$1(object);
270
+ return Reflect.ownKeys(oo).length <= 0;
271
+ };
262
272
  var object$5 = {
263
273
  getValue: getValue$5,
264
274
  setValue: setValue$5,
@@ -12159,4 +12169,4 @@ var TimerManager = (function () {
12159
12169
 
12160
12170
  var index = __assign$b(__assign$b(__assign$b(__assign$b(__assign$b(__assign$b(__assign$b(__assign$b(__assign$b(__assign$b(__assign$b({}, object$5), base$5), array$5), __function$5), element$5), __static$5), event$5), storage$5), log$5), animate$5), { eventMessageCenter: MessageCenter$5, taskQueueLib: TaskQueue$3, JSRequest: Request$1, TimerManager: TimerManager });
12161
12171
 
12162
- export { AnimateFrame$5 as AnimateFrame, MessageCenter$5 as MessageCenter, NBezier$5 as NBezier, Request$1 as Request, TaskQueue$3 as TaskQueue, TimerManager, addHandler$5 as addHandler, arrayDemote$5 as arrayDemote, arrayRandom$5 as arrayRandom, arrayUniq$5 as arrayUniq, catchAwait$5 as catchAwait, classDecorator$5 as classDecorator, clearStorage$5 as clearStorage, cloneDeep$5 as cloneDeep, combination$5 as combination, createElement$5 as createElement, createObject$5 as createObject, createObjectVariable$5 as createObjectVariable, cubicBezier$5 as cubicBezier, debounce$5 as debounce, decoratorMessageCenter$5 as decoratorMessageCenter, index as default, defaultOptions, defer$5 as defer, dispatchEvent$5 as dispatchEvent, emptyObject$1 as emptyObject, enumInversion$5 as enumInversion, factorial$5 as factorial, getInstance$5 as getInstance, getStorage$5 as getStorage, getType$5 as getType, getTypeByList$5 as getTypeByList, getValue$5 as getValue, inherit$5 as inherit, isNotObject$5 as isNotObject, isWindow$5 as isWindow, jsonToString$5 as jsonToString, logLoop$5 as logLoop, logOneLine$5 as logOneLine, messageCenter, mixIn$5 as mixIn, quadraticBezier$5 as quadraticBezier, randomNum$5 as randomNum, removeHandler$5 as removeHandler, requestFrame$2 as requestFrame, setStorage$5 as setStorage, setValue$5 as setValue, stopBubble$5 as stopBubble, stopDefault$5 as stopDefault, stringToJson$5 as stringToJson, throttle$5 as throttle, types$5 as types, urlJoin$5 as urlJoin, urlSplit$5 as urlSplit };
12172
+ export { AnimateFrame$5 as AnimateFrame, MessageCenter$5 as MessageCenter, NBezier$5 as NBezier, Request$1 as Request, TaskQueue$3 as TaskQueue, TimerManager, addHandler$5 as addHandler, arrayDemote$5 as arrayDemote, arrayRandom$5 as arrayRandom, arrayUniq$5 as arrayUniq, catchAwait$5 as catchAwait, classDecorator$5 as classDecorator, clearStorage$5 as clearStorage, cloneDeep$5 as cloneDeep, combination$5 as combination, createElement$5 as createElement, createObject$5 as createObject, createObjectVariable$5 as createObjectVariable, cubicBezier$5 as cubicBezier, debounce$5 as debounce, decoratorMessageCenter$5 as decoratorMessageCenter, index as default, defaultOptions, defer$5 as defer, dispatchEvent$5 as dispatchEvent, emptyObject$1 as emptyObject, enumInversion$5 as enumInversion, factorial$5 as factorial, getInstance$5 as getInstance, getStorage$5 as getStorage, getType$5 as getType, getTypeByList$5 as getTypeByList, getValue$5 as getValue, inherit$5 as inherit, isEmptyObject, isNotObject$5 as isNotObject, isWindow$5 as isWindow, jsonToString$5 as jsonToString, logLoop$5 as logLoop, logOneLine$5 as logOneLine, messageCenter, mixIn$5 as mixIn, quadraticBezier$5 as quadraticBezier, randomNum$5 as randomNum, removeHandler$5 as removeHandler, requestFrame$2 as requestFrame, setStorage$5 as setStorage, setValue$5 as setValue, stopBubble$5 as stopBubble, stopDefault$5 as stopDefault, stringToJson$5 as stringToJson, throttle$5 as throttle, toKebabCase, types$5 as types, urlJoin$5 as urlJoin, urlSplit$5 as urlSplit };
@@ -14,6 +14,7 @@ export declare const stringToJson: IStringToJson;
14
14
  export declare const jsonToString: IJsonToString;
15
15
  export declare const isWindow: (win: any) => boolean;
16
16
  export declare const emptyObject: (init?: IObject<unknown>) => any;
17
+ export declare const isEmptyObject: (object?: IObject<unknown>) => boolean;
17
18
  declare const _default: {
18
19
  getValue: IGetValue;
19
20
  setValue: ISetValue;
@@ -5,11 +5,13 @@ export declare const urlSplit: IUrlSplit;
5
5
  export declare const urlJoin: IUrlJoin;
6
6
  export declare const getType: IGetType<types>;
7
7
  export declare const getTypeByList: IGetTypeByList;
8
+ export declare const toKebabCase: (camelCase: string, separator?: string) => string;
8
9
  declare const _default: {
9
10
  randomNum: IRandomNum;
10
11
  urlSplit: IUrlSplit;
11
12
  urlJoin: IUrlJoin;
12
13
  getType: IGetType<types>;
13
14
  getTypeByList: IGetTypeByList;
15
+ toKebabCase: (camelCase: string, separator?: string) => string;
14
16
  };
15
17
  export default _default;
@@ -52,6 +52,7 @@ declare const _default: {
52
52
  urlJoin: import("./types").IUrlJoin;
53
53
  getType: import("./types").IGetType<import("./static").types>;
54
54
  getTypeByList: import("./types").IGetTypeByList;
55
+ toKebabCase: (camelCase: string, separator?: string) => string;
55
56
  getValue: import("./types").IGetValue;
56
57
  setValue: import("./types").ISetValue;
57
58
  mixIn: import("./types").IMixIn;
package/dist/umd/index.js CHANGED
@@ -95,12 +95,17 @@
95
95
  var __type = getType$5(data);
96
96
  return whiteList.indexOf(__type) > 0;
97
97
  };
98
+ var toKebabCase = function (camelCase, separator) {
99
+ if (separator === void 0) { separator = "-"; }
100
+ return camelCase.replace(/[A-Z]/g, function (m) { return "".concat(separator).concat(m.toLowerCase()); });
101
+ };
98
102
  var base$5 = {
99
103
  randomNum: randomNum$5,
100
104
  urlSplit: urlSplit$5,
101
105
  urlJoin: urlJoin$5,
102
106
  getType: getType$5,
103
107
  getTypeByList: getTypeByList$5,
108
+ toKebabCase: toKebabCase,
104
109
  };
105
110
 
106
111
  var getValue$5 = function (object, key, defaultValue) {
@@ -261,6 +266,11 @@
261
266
  Reflect.ownKeys(init).forEach(function (k) { return _o[k] = init[k]; });
262
267
  return _o;
263
268
  };
269
+ var isEmptyObject = function (object) {
270
+ if (object === void 0) { object = {}; }
271
+ var oo = emptyObject$1(object);
272
+ return Reflect.ownKeys(oo).length <= 0;
273
+ };
264
274
  var object$5 = {
265
275
  getValue: getValue$5,
266
276
  setValue: setValue$5,
@@ -12195,6 +12205,7 @@
12195
12205
  exports.getTypeByList = getTypeByList$5;
12196
12206
  exports.getValue = getValue$5;
12197
12207
  exports.inherit = inherit$5;
12208
+ exports.isEmptyObject = isEmptyObject;
12198
12209
  exports.isNotObject = isNotObject$5;
12199
12210
  exports.isWindow = isWindow$5;
12200
12211
  exports.jsonToString = jsonToString$5;
@@ -12212,6 +12223,7 @@
12212
12223
  exports.stopDefault = stopDefault$5;
12213
12224
  exports.stringToJson = stringToJson$5;
12214
12225
  exports.throttle = throttle$5;
12226
+ exports.toKebabCase = toKebabCase;
12215
12227
  exports.urlJoin = urlJoin$5;
12216
12228
  exports.urlSplit = urlSplit$5;
12217
12229
 
@@ -14,6 +14,7 @@ export declare const stringToJson: IStringToJson;
14
14
  export declare const jsonToString: IJsonToString;
15
15
  export declare const isWindow: (win: any) => boolean;
16
16
  export declare const emptyObject: (init?: IObject<unknown>) => any;
17
+ export declare const isEmptyObject: (object?: IObject<unknown>) => boolean;
17
18
  declare const _default: {
18
19
  getValue: IGetValue;
19
20
  setValue: ISetValue;
package/package.json CHANGED
@@ -1,50 +1,50 @@
1
- {
2
- "name": "utils-lib-js",
3
- "version": "2.0.14",
4
- "description": "JavaScript工具函数,封装的一些常用的js函数",
5
- "main": "./dist/cjs/index.js",
6
- "types": "./dist/cjs/index.d.ts",
7
- "module": "./dist/esm/index.js",
8
- "type": "module",
9
- "exports": {
10
- "import": "./dist/esm/index.js",
11
- "require": "./dist/cjs/index.js"
12
- },
13
- "scripts": {
14
- "debug": "start cmd /k pnpm run build:hot & pnpm run node:hot",
15
- "node:hot": "nodemon example.js --watch example.js",
16
- "build:hot": "pnpm rollup -c --watch",
17
- "build": "pnpm run rollup:build && pnpm run commonjs",
18
- "rollup:build": "rm -fr dist && pnpm rollup -c",
19
- "build:publish": "pnpm run build && pnpm publish",
20
- "commonjs": "cp ./commonjs.json dist/cjs/package.json"
21
- },
22
- "repository": {
23
- "type": "git",
24
- "url": "https://gitee.com/DieHunter/utils-lib-js.git"
25
- },
26
- "keywords": [
27
- "utils",
28
- "tools",
29
- "lib"
30
- ],
31
- "author": "",
32
- "license": "ISC",
33
- "devDependencies": {
34
- "@rollup/plugin-alias": "^4.0.3",
35
- "@rollup/plugin-node-resolve": "^15.0.1",
36
- "@rollup/plugin-typescript": "^11.0.0",
37
- "@types/node": "^18.7.15",
38
- "rollup": "^3.20.2",
39
- "rollup-plugin-terser": "^7.0.2",
40
- "tslib": "^2.5.0",
41
- "typescript": "^4.9.0"
42
- },
43
- "dependencies": {
44
- "event-message-center": "^1.4.0",
45
- "js-request-lib": "^1.0.7",
46
- "task-queue-lib": "^1.4.2",
47
- "timer-manager-lib": "^1.0.0"
48
- },
49
- "umdModuleName": "UtilsLib"
50
- }
1
+ {
2
+ "name": "utils-lib-js",
3
+ "version": "2.0.16",
4
+ "description": "JavaScript工具函数,封装的一些常用的js函数",
5
+ "main": "./dist/cjs/index.js",
6
+ "types": "./dist/cjs/index.d.ts",
7
+ "module": "./dist/esm/index.js",
8
+ "type": "module",
9
+ "exports": {
10
+ "import": "./dist/esm/index.js",
11
+ "require": "./dist/cjs/index.js"
12
+ },
13
+ "scripts": {
14
+ "debug": "start cmd /k pnpm run build:hot & pnpm run node:hot",
15
+ "node:hot": "nodemon example.js --watch example.js",
16
+ "build:hot": "pnpm rollup -c --watch",
17
+ "build": "pnpm run rollup:build && pnpm run commonjs",
18
+ "rollup:build": "rm -fr dist && pnpm rollup -c",
19
+ "build:publish": "pnpm run build && pnpm publish",
20
+ "commonjs": "cp ./commonjs.json dist/cjs/package.json"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://gitee.com/DieHunter/utils-lib-js.git"
25
+ },
26
+ "keywords": [
27
+ "utils",
28
+ "tools",
29
+ "lib"
30
+ ],
31
+ "author": "",
32
+ "license": "ISC",
33
+ "devDependencies": {
34
+ "@rollup/plugin-alias": "^4.0.3",
35
+ "@rollup/plugin-node-resolve": "^15.0.1",
36
+ "@rollup/plugin-typescript": "^11.0.0",
37
+ "@types/node": "^18.7.15",
38
+ "rollup": "^3.20.2",
39
+ "rollup-plugin-terser": "^7.0.2",
40
+ "tslib": "^2.5.0",
41
+ "typescript": "^4.9.0"
42
+ },
43
+ "dependencies": {
44
+ "event-message-center": "^1.4.0",
45
+ "js-request-lib": "^1.0.7",
46
+ "task-queue-lib": "^1.4.2",
47
+ "timer-manager-lib": "^1.0.0"
48
+ },
49
+ "umdModuleName": "UtilsLib"
50
+ }