@qqi/log 1.1.2 → 1.1.4

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.
package/cjs/core.js CHANGED
@@ -18,7 +18,7 @@ var DogConstructor = aJsTools.createConstructor(Dog);
18
18
  * @returns - dev log 工厂函数
19
19
  */
20
20
  function Dog(options) {
21
- var _this = this;
21
+ var _this_1 = this;
22
22
  var _p = util.parseOption(options);
23
23
  this.name = _p.name || aJsTools.getRandomString(12);
24
24
  this.fold = Boolean(_p.fold);
@@ -61,16 +61,16 @@ function Dog(options) {
61
61
  ? colorPen.bgBlackPen.red
62
62
  : colorPen.bgBrightYellowPen.brightGreen)(startStr);
63
63
  var mark = (_e = res === null || res === void 0 ? void 0 : res.name) !== null && _e !== void 0 ? _e : '';
64
- if (_this.fold && mark) {
65
- if (mark === _this.mark) ;
64
+ if (_this_1.fold && mark) {
65
+ if (mark === _this_1.mark) ;
66
66
  else {
67
- if (_this.mark) {
67
+ if (_this_1.mark) {
68
68
  console.groupEnd();
69
69
  }
70
70
  console.groupCollapsed(mark);
71
71
  }
72
72
  }
73
- _this.mark = mark;
73
+ _this_1.mark = mark;
74
74
  var msg = "".concat(printStartPenStr, " ").concat(mark, " ").concat((_f = res === null || res === void 0 ? void 0 : res.line) === null || _f === void 0 ? void 0 : _f.concat(' 行'), " ").concat((_g = res === null || res === void 0 ? void 0 : res.column) === null || _g === void 0 ? void 0 : _g.concat(' 列'));
75
75
  return colorPen.colorText(msg);
76
76
  }
@@ -80,7 +80,7 @@ function Dog(options) {
80
80
  for (var _i = 0; _i < arguments.length; _i++) {
81
81
  arg[_i] = arguments[_i];
82
82
  }
83
- if (_this.type === 'all' || _this.type === 'info' || _this.type === true) {
83
+ if (_this_1.type === 'all' || _this_1.type === 'info' || _this_1.type === true) {
84
84
  var _prefix = prefix('info');
85
85
  console.log.apply(console, _prefix);
86
86
  console.log.apply(console, arg);
@@ -95,7 +95,7 @@ function Dog(options) {
95
95
  for (var _i = 0; _i < arguments.length; _i++) {
96
96
  msg[_i] = arguments[_i];
97
97
  }
98
- if (_this.type === 'all' || _this.type === 'warn' || _this.type === true) {
98
+ if (_this_1.type === 'all' || _this_1.type === 'warn' || _this_1.type === true) {
99
99
  var _prefix = prefix('warn');
100
100
  console.log.apply(console, _prefix);
101
101
  console.warn.apply(console, msg);
@@ -110,7 +110,7 @@ function Dog(options) {
110
110
  for (var _i = 0; _i < arguments.length; _i++) {
111
111
  msg[_i] = arguments[_i];
112
112
  }
113
- if (_this.type === 'all' || _this.type === 'error' || _this.type === true) {
113
+ if (_this_1.type === 'all' || _this_1.type === 'error' || _this_1.type === true) {
114
114
  var _prefix = prefix('error');
115
115
  console.log.apply(console, _prefix);
116
116
  console.error.apply(console, msg);
@@ -125,11 +125,25 @@ function Dog(options) {
125
125
  for (var _i = 0; _i < arguments.length; _i++) {
126
126
  str[_i] = arguments[_i];
127
127
  }
128
- _this.info.apply(_this, str);
128
+ _this_1.info.apply(_this_1, str);
129
129
  };
130
130
  // 设置 prototype
131
131
  Object.setPrototypeOf(dog, this);
132
- return dog;
132
+ var _this = this;
133
+ return new Proxy(dog, {
134
+ get: function (target, p, receiver) {
135
+ if (p === 'apply') {
136
+ return target;
137
+ }
138
+ else {
139
+ return Reflect.get(target, p, receiver);
140
+ }
141
+ },
142
+ set: function (_target, p, newValue) {
143
+ Reflect.set(_this, p, newValue); // 将要设置的值映射到 this 上而不是自身
144
+ return true;
145
+ },
146
+ });
133
147
  }
134
148
  /** 原型上添加 clear 方法 */
135
149
  Dog.prototype.clear = function () {
package/cjs/util.js CHANGED
@@ -13,7 +13,7 @@ var aTypeOfJs = require('a-type-of-js');
13
13
  * @copyright 2026 ©️ MrMudBean
14
14
  * @since 2026-01-28 03:11
15
15
  * @version 1.0.1
16
- * @lastModified 2026-01-28 04:34
16
+ * @lastModified 2026-02-03 15:07
17
17
  */
18
18
  var typeList = [
19
19
  false,
@@ -45,9 +45,9 @@ function parseOption(options) {
45
45
  return result;
46
46
  }
47
47
  if (aTypeOfJs.isString(options.name)) {
48
- result.name = options.name.trim().replace(/\s+/g, '_');
49
- return result;
48
+ options.name = options.name.trim().replace(/\s+/g, '_');
50
49
  }
50
+ options.fold = Boolean(options.fold);
51
51
  return options;
52
52
  }
53
53
  /**
package/es/core.js CHANGED
@@ -16,7 +16,7 @@ var DogConstructor = createConstructor(Dog);
16
16
  * @returns - dev log 工厂函数
17
17
  */
18
18
  function Dog(options) {
19
- var _this = this;
19
+ var _this_1 = this;
20
20
  var _p = parseOption(options);
21
21
  this.name = _p.name || getRandomString(12);
22
22
  this.fold = Boolean(_p.fold);
@@ -59,16 +59,16 @@ function Dog(options) {
59
59
  ? bgBlackPen.red
60
60
  : bgBrightYellowPen.brightGreen)(startStr);
61
61
  var mark = (_e = res === null || res === void 0 ? void 0 : res.name) !== null && _e !== void 0 ? _e : '';
62
- if (_this.fold && mark) {
63
- if (mark === _this.mark) ;
62
+ if (_this_1.fold && mark) {
63
+ if (mark === _this_1.mark) ;
64
64
  else {
65
- if (_this.mark) {
65
+ if (_this_1.mark) {
66
66
  console.groupEnd();
67
67
  }
68
68
  console.groupCollapsed(mark);
69
69
  }
70
70
  }
71
- _this.mark = mark;
71
+ _this_1.mark = mark;
72
72
  var msg = "".concat(printStartPenStr, " ").concat(mark, " ").concat((_f = res === null || res === void 0 ? void 0 : res.line) === null || _f === void 0 ? void 0 : _f.concat(' 行'), " ").concat((_g = res === null || res === void 0 ? void 0 : res.column) === null || _g === void 0 ? void 0 : _g.concat(' 列'));
73
73
  return colorText(msg);
74
74
  }
@@ -78,7 +78,7 @@ function Dog(options) {
78
78
  for (var _i = 0; _i < arguments.length; _i++) {
79
79
  arg[_i] = arguments[_i];
80
80
  }
81
- if (_this.type === 'all' || _this.type === 'info' || _this.type === true) {
81
+ if (_this_1.type === 'all' || _this_1.type === 'info' || _this_1.type === true) {
82
82
  var _prefix = prefix('info');
83
83
  console.log.apply(console, _prefix);
84
84
  console.log.apply(console, arg);
@@ -93,7 +93,7 @@ function Dog(options) {
93
93
  for (var _i = 0; _i < arguments.length; _i++) {
94
94
  msg[_i] = arguments[_i];
95
95
  }
96
- if (_this.type === 'all' || _this.type === 'warn' || _this.type === true) {
96
+ if (_this_1.type === 'all' || _this_1.type === 'warn' || _this_1.type === true) {
97
97
  var _prefix = prefix('warn');
98
98
  console.log.apply(console, _prefix);
99
99
  console.warn.apply(console, msg);
@@ -108,7 +108,7 @@ function Dog(options) {
108
108
  for (var _i = 0; _i < arguments.length; _i++) {
109
109
  msg[_i] = arguments[_i];
110
110
  }
111
- if (_this.type === 'all' || _this.type === 'error' || _this.type === true) {
111
+ if (_this_1.type === 'all' || _this_1.type === 'error' || _this_1.type === true) {
112
112
  var _prefix = prefix('error');
113
113
  console.log.apply(console, _prefix);
114
114
  console.error.apply(console, msg);
@@ -123,11 +123,25 @@ function Dog(options) {
123
123
  for (var _i = 0; _i < arguments.length; _i++) {
124
124
  str[_i] = arguments[_i];
125
125
  }
126
- _this.info.apply(_this, str);
126
+ _this_1.info.apply(_this_1, str);
127
127
  };
128
128
  // 设置 prototype
129
129
  Object.setPrototypeOf(dog, this);
130
- return dog;
130
+ var _this = this;
131
+ return new Proxy(dog, {
132
+ get: function (target, p, receiver) {
133
+ if (p === 'apply') {
134
+ return target;
135
+ }
136
+ else {
137
+ return Reflect.get(target, p, receiver);
138
+ }
139
+ },
140
+ set: function (_target, p, newValue) {
141
+ Reflect.set(_this, p, newValue); // 将要设置的值映射到 this 上而不是自身
142
+ return true;
143
+ },
144
+ });
131
145
  }
132
146
  /** 原型上添加 clear 方法 */
133
147
  Dog.prototype.clear = function () {
@@ -431,6 +431,7 @@ declare const _default: ({
431
431
  HTMLFormElement: false;
432
432
  HTMLFrameElement: false;
433
433
  HTMLFrameSetElement: false;
434
+ HTMLGeolocationElement: false;
434
435
  HTMLHeadElement: false;
435
436
  HTMLHeadingElement: false;
436
437
  HTMLHRElement: false;
@@ -1179,6 +1180,7 @@ declare const _default: ({
1179
1180
  XRView: false;
1180
1181
  XRViewerPose: false;
1181
1182
  XRViewport: false;
1183
+ XRVisibilityMaskChangeEvent: false;
1182
1184
  XRWebGLBinding: false;
1183
1185
  XRWebGLDepthInformation: false;
1184
1186
  XRWebGLLayer: false;
@@ -11,7 +11,7 @@ declare namespace _default {
11
11
  exports: string;
12
12
  dir: string;
13
13
  }[];
14
- let external: (id: string) => boolean;
14
+ let external: (id: string, parentId: string | undefined, isHandle: boolean) => boolean;
15
15
  let plugins: import("rollup").Plugin<any>[];
16
16
  }
17
17
  export default _default;
@@ -8,7 +8,7 @@ declare namespace _default {
8
8
  let exports: string;
9
9
  let dir: string;
10
10
  }
11
- let external: (id: string) => boolean;
11
+ let external: (id: string, parentId: string | undefined, isHandle: boolean) => boolean;
12
12
  let plugins: import("rollup").Plugin<any>[];
13
13
  }
14
14
  export default _default;
package/es/src/util.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * @copyright 2026 ©️ MrMudBean
9
9
  * @since 2026-01-28 03:11
10
10
  * @version 1.0.1
11
- * @lastModified 2026-01-28 04:34
11
+ * @lastModified 2026-02-03 15:07
12
12
  */
13
13
  import { DevLogType } from '@qqi/log';
14
14
  import { DogOptions } from './type';
package/es/util.js CHANGED
@@ -11,7 +11,7 @@ import { isUndefined, isBoolean, isString } from 'a-type-of-js';
11
11
  * @copyright 2026 ©️ MrMudBean
12
12
  * @since 2026-01-28 03:11
13
13
  * @version 1.0.1
14
- * @lastModified 2026-01-28 04:34
14
+ * @lastModified 2026-02-03 15:07
15
15
  */
16
16
  var typeList = [
17
17
  false,
@@ -43,9 +43,9 @@ function parseOption(options) {
43
43
  return result;
44
44
  }
45
45
  if (isString(options.name)) {
46
- result.name = options.name.trim().replace(/\s+/g, '_');
47
- return result;
46
+ options.name = options.name.trim().replace(/\s+/g, '_');
48
47
  }
48
+ options.fold = Boolean(options.fold);
49
49
  return options;
50
50
  }
51
51
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "name": "@qqi/log",
5
5
  "main": "cjs/index.js",
6
6
  "module": "es/index.js",