@noah-libjs/utils 0.0.2
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/LICENSE +21 -0
- package/README.md +23 -0
- package/dist/Event.d.ts +27 -0
- package/dist/helper.d.ts +8 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +951 -0
- package/dist/json-helper.d.ts +3 -0
- package/dist/log.d.ts +17 -0
- package/dist/moment-help.d.ts +35 -0
- package/dist/small-fn.d.ts +37 -0
- package/dist/type-utils.d.ts +9 -0
- package/package.json +35 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Lam
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Rslib project
|
|
2
|
+
|
|
3
|
+
## Setup
|
|
4
|
+
|
|
5
|
+
Install the dependencies:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm install
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Get started
|
|
12
|
+
|
|
13
|
+
Build the library:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm build
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Build the library in watch mode:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm dev
|
|
23
|
+
```
|
package/dist/Event.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { MyLog } from "./log";
|
|
2
|
+
export declare class EventEmitter<TypeMapInterface extends {
|
|
3
|
+
[x: string]: any[];
|
|
4
|
+
}> {
|
|
5
|
+
events: {
|
|
6
|
+
[x in keyof TypeMapInterface]?: Array<(...args: TypeMapInterface[x]) => void>;
|
|
7
|
+
};
|
|
8
|
+
constructor();
|
|
9
|
+
addListener<T extends keyof TypeMapInterface>(event: T, listener: (...args: TypeMapInterface[T]) => void): this;
|
|
10
|
+
on<T extends keyof TypeMapInterface>(event: T, listener: (...args: TypeMapInterface[T]) => void): this;
|
|
11
|
+
on_cb<T extends keyof TypeMapInterface>(event: T, listener: (...args: TypeMapInterface[T]) => void): (...args: TypeMapInterface[T]) => void;
|
|
12
|
+
on_rm<T extends keyof TypeMapInterface>(event: T, listener: (...args: TypeMapInterface[T]) => void): () => void;
|
|
13
|
+
static logger: MyLog;
|
|
14
|
+
emit<T extends keyof TypeMapInterface>(event: T, ...args: TypeMapInterface[T]): boolean;
|
|
15
|
+
removeAllListeners<T extends keyof TypeMapInterface>(event: T): this;
|
|
16
|
+
off<T extends keyof TypeMapInterface>(event: T, listener: (...args: TypeMapInterface[T]) => void): this;
|
|
17
|
+
once<T extends keyof TypeMapInterface>(event: T, listener: (...args: TypeMapInterface[T]) => void): this;
|
|
18
|
+
prependListener<T extends keyof TypeMapInterface>(event: keyof TypeMapInterface, listener: (...args: any[]) => void): this;
|
|
19
|
+
prependOnceListener<T extends keyof TypeMapInterface>(event: keyof TypeMapInterface, listener: (...args: any[]) => void): this;
|
|
20
|
+
removeListener<T extends keyof TypeMapInterface>(event: keyof TypeMapInterface, listener: (...args: any[]) => void): this;
|
|
21
|
+
setMaxListeners(n: number): this;
|
|
22
|
+
getMaxListeners(): number;
|
|
23
|
+
listeners<T extends keyof TypeMapInterface>(event: keyof TypeMapInterface): Function[];
|
|
24
|
+
rawListeners<T extends keyof TypeMapInterface>(event: keyof TypeMapInterface): Function[];
|
|
25
|
+
eventNames(): Array<keyof TypeMapInterface>;
|
|
26
|
+
listenerCount(type: string): number;
|
|
27
|
+
}
|
package/dist/helper.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { isFunction, isNumber, isObject, isString, keys, toInt, toFloat, isArray, isSymbol, get, set, clone, map, mapValues, mapEntries, omit, pick, unique, isEqual } from "radash";
|
|
2
|
+
export { isFunction, isNumber, isObject, isString, keys, toInt, toFloat, isArray, isSymbol, get, set, clone, map, mapValues, mapEntries, omit, pick, unique, isEqual };
|
|
3
|
+
export declare function isBoolean(value: any): value is boolean;
|
|
4
|
+
export declare function isObjectLike(value: any): boolean;
|
|
5
|
+
export declare function isNull(value: any): value is null;
|
|
6
|
+
export declare function isNil(value: any): value is null | undefined;
|
|
7
|
+
export declare function toString(value: any): string;
|
|
8
|
+
export declare function cloneDeep<T>(value: T): T | null;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,951 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
6
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
7
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
12
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
|
+
import dayjs from 'dayjs';
|
|
15
|
+
export { Dayjs, default as dayjs } from 'dayjs';
|
|
16
|
+
var isSymbol = function isSymbol(value) {
|
|
17
|
+
return !!value && value.constructor === Symbol;
|
|
18
|
+
};
|
|
19
|
+
var isArray = Array.isArray;
|
|
20
|
+
var isObject = function isObject(value) {
|
|
21
|
+
return !!value && value.constructor === Object;
|
|
22
|
+
};
|
|
23
|
+
var isPrimitive = function isPrimitive(value) {
|
|
24
|
+
return value === void 0 || value === null || _typeof(value) !== "object" && typeof value !== "function";
|
|
25
|
+
};
|
|
26
|
+
var isFunction = function isFunction(value) {
|
|
27
|
+
return !!(value && value.constructor && value.call && value.apply);
|
|
28
|
+
};
|
|
29
|
+
var isString = function isString(value) {
|
|
30
|
+
return typeof value === "string" || value instanceof String;
|
|
31
|
+
};
|
|
32
|
+
var isNumber = function isNumber(value) {
|
|
33
|
+
try {
|
|
34
|
+
return Number(value) === value;
|
|
35
|
+
} catch (_unused) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var _isEqual = function isEqual(x, y) {
|
|
40
|
+
if (Object.is(x, y)) return true;
|
|
41
|
+
if (x instanceof Date && y instanceof Date) {
|
|
42
|
+
return x.getTime() === y.getTime();
|
|
43
|
+
}
|
|
44
|
+
if (x instanceof RegExp && y instanceof RegExp) {
|
|
45
|
+
return x.toString() === y.toString();
|
|
46
|
+
}
|
|
47
|
+
if (_typeof(x) !== "object" || x === null || _typeof(y) !== "object" || y === null) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
var keysX = Reflect.ownKeys(x);
|
|
51
|
+
var keysY = Reflect.ownKeys(y);
|
|
52
|
+
if (keysX.length !== keysY.length) return false;
|
|
53
|
+
for (var i = 0; i < keysX.length; i++) {
|
|
54
|
+
if (!Reflect.has(y, keysX[i])) return false;
|
|
55
|
+
if (!_isEqual(x[keysX[i]], y[keysX[i]])) return false;
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
};
|
|
59
|
+
var unique = function unique(array, toKey) {
|
|
60
|
+
var valueMap = array.reduce(function (acc, item) {
|
|
61
|
+
var key = toKey ? toKey(item) : item;
|
|
62
|
+
if (acc[key]) return acc;
|
|
63
|
+
acc[key] = item;
|
|
64
|
+
return acc;
|
|
65
|
+
}, {});
|
|
66
|
+
return Object.values(valueMap);
|
|
67
|
+
};
|
|
68
|
+
var map = /*#__PURE__*/function () {
|
|
69
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(array, asyncMapFunc) {
|
|
70
|
+
var result, index, _iterator, _step, value, newValue;
|
|
71
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
72
|
+
while (1) switch (_context.prev = _context.next) {
|
|
73
|
+
case 0:
|
|
74
|
+
if (array) {
|
|
75
|
+
_context.next = 2;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
return _context.abrupt("return", []);
|
|
79
|
+
case 2:
|
|
80
|
+
result = [];
|
|
81
|
+
index = 0;
|
|
82
|
+
_iterator = _createForOfIteratorHelper(array);
|
|
83
|
+
_context.prev = 5;
|
|
84
|
+
_iterator.s();
|
|
85
|
+
case 7:
|
|
86
|
+
if ((_step = _iterator.n()).done) {
|
|
87
|
+
_context.next = 15;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
value = _step.value;
|
|
91
|
+
_context.next = 11;
|
|
92
|
+
return asyncMapFunc(value, index++);
|
|
93
|
+
case 11:
|
|
94
|
+
newValue = _context.sent;
|
|
95
|
+
result.push(newValue);
|
|
96
|
+
case 13:
|
|
97
|
+
_context.next = 7;
|
|
98
|
+
break;
|
|
99
|
+
case 15:
|
|
100
|
+
_context.next = 20;
|
|
101
|
+
break;
|
|
102
|
+
case 17:
|
|
103
|
+
_context.prev = 17;
|
|
104
|
+
_context.t0 = _context["catch"](5);
|
|
105
|
+
_iterator.e(_context.t0);
|
|
106
|
+
case 20:
|
|
107
|
+
_context.prev = 20;
|
|
108
|
+
_iterator.f();
|
|
109
|
+
return _context.finish(20);
|
|
110
|
+
case 23:
|
|
111
|
+
return _context.abrupt("return", result);
|
|
112
|
+
case 24:
|
|
113
|
+
case "end":
|
|
114
|
+
return _context.stop();
|
|
115
|
+
}
|
|
116
|
+
}, _callee, null, [[5, 17, 20, 23]]);
|
|
117
|
+
}));
|
|
118
|
+
return function map(_x, _x2) {
|
|
119
|
+
return _ref.apply(this, arguments);
|
|
120
|
+
};
|
|
121
|
+
}();
|
|
122
|
+
var toFloat = function toFloat(value, defaultValue) {
|
|
123
|
+
var def = defaultValue === void 0 ? 0 : defaultValue;
|
|
124
|
+
if (value === null || value === void 0) {
|
|
125
|
+
return def;
|
|
126
|
+
}
|
|
127
|
+
var result = parseFloat(value);
|
|
128
|
+
return isNaN(result) ? def : result;
|
|
129
|
+
};
|
|
130
|
+
var toInt = function toInt(value, defaultValue) {
|
|
131
|
+
var def = defaultValue === void 0 ? 0 : defaultValue;
|
|
132
|
+
if (value === null || value === void 0) {
|
|
133
|
+
return def;
|
|
134
|
+
}
|
|
135
|
+
var result = parseInt(value);
|
|
136
|
+
return isNaN(result) ? def : result;
|
|
137
|
+
};
|
|
138
|
+
var mapValues = function mapValues(obj, mapFunc) {
|
|
139
|
+
var keys2 = Object.keys(obj);
|
|
140
|
+
return keys2.reduce(function (acc, key) {
|
|
141
|
+
acc[key] = mapFunc(obj[key], key);
|
|
142
|
+
return acc;
|
|
143
|
+
}, {});
|
|
144
|
+
};
|
|
145
|
+
var mapEntries = function mapEntries(obj, toEntry) {
|
|
146
|
+
if (!obj) return {};
|
|
147
|
+
return Object.entries(obj).reduce(function (acc, _ref2) {
|
|
148
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
149
|
+
key = _ref3[0],
|
|
150
|
+
value = _ref3[1];
|
|
151
|
+
var _toEntry = toEntry(key, value),
|
|
152
|
+
_toEntry2 = _slicedToArray(_toEntry, 2),
|
|
153
|
+
newKey = _toEntry2[0],
|
|
154
|
+
newValue = _toEntry2[1];
|
|
155
|
+
acc[newKey] = newValue;
|
|
156
|
+
return acc;
|
|
157
|
+
}, {});
|
|
158
|
+
};
|
|
159
|
+
var clone = function clone(obj) {
|
|
160
|
+
if (isPrimitive(obj)) {
|
|
161
|
+
return obj;
|
|
162
|
+
}
|
|
163
|
+
if (typeof obj === "function") {
|
|
164
|
+
return obj.bind({});
|
|
165
|
+
}
|
|
166
|
+
var newObj = new obj.constructor();
|
|
167
|
+
Object.getOwnPropertyNames(obj).forEach(function (prop) {
|
|
168
|
+
newObj[prop] = obj[prop];
|
|
169
|
+
});
|
|
170
|
+
return newObj;
|
|
171
|
+
};
|
|
172
|
+
var pick = function pick(obj, keys2) {
|
|
173
|
+
if (!obj) return {};
|
|
174
|
+
return keys2.reduce(function (acc, key) {
|
|
175
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) acc[key] = obj[key];
|
|
176
|
+
return acc;
|
|
177
|
+
}, {});
|
|
178
|
+
};
|
|
179
|
+
var omit = function omit(obj, keys2) {
|
|
180
|
+
if (!obj) return {};
|
|
181
|
+
if (!keys2 || keys2.length === 0) return obj;
|
|
182
|
+
return keys2.reduce(function (acc, key) {
|
|
183
|
+
delete acc[key];
|
|
184
|
+
return acc;
|
|
185
|
+
}, _objectSpread({}, obj));
|
|
186
|
+
};
|
|
187
|
+
var get = function get(value, path, defaultValue) {
|
|
188
|
+
var segments = path.split(/[\.\[\]]/g);
|
|
189
|
+
var current = value;
|
|
190
|
+
var _iterator2 = _createForOfIteratorHelper(segments),
|
|
191
|
+
_step2;
|
|
192
|
+
try {
|
|
193
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
194
|
+
var key = _step2.value;
|
|
195
|
+
if (current === null) return defaultValue;
|
|
196
|
+
if (current === void 0) return defaultValue;
|
|
197
|
+
var dequoted = key.replace(/['"]/g, "");
|
|
198
|
+
if (dequoted.trim() === "") continue;
|
|
199
|
+
current = current[dequoted];
|
|
200
|
+
}
|
|
201
|
+
} catch (err) {
|
|
202
|
+
_iterator2.e(err);
|
|
203
|
+
} finally {
|
|
204
|
+
_iterator2.f();
|
|
205
|
+
}
|
|
206
|
+
if (current === void 0) return defaultValue;
|
|
207
|
+
return current;
|
|
208
|
+
};
|
|
209
|
+
var set = function set(initial, path, value) {
|
|
210
|
+
if (!initial) return {};
|
|
211
|
+
if (!path || value === void 0) return initial;
|
|
212
|
+
var segments = path.split(/[\.\[\]]/g).filter(function (x) {
|
|
213
|
+
return !!x.trim();
|
|
214
|
+
});
|
|
215
|
+
var _set2 = function _set(node) {
|
|
216
|
+
if (segments.length > 1) {
|
|
217
|
+
var key = segments.shift();
|
|
218
|
+
var nextIsNum = toInt(segments[0], null) === null ? false : true;
|
|
219
|
+
node[key] = node[key] === void 0 ? nextIsNum ? [] : {} : node[key];
|
|
220
|
+
_set2(node[key]);
|
|
221
|
+
} else {
|
|
222
|
+
node[segments[0]] = value;
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
var cloned = clone(initial);
|
|
226
|
+
_set2(cloned);
|
|
227
|
+
return cloned;
|
|
228
|
+
};
|
|
229
|
+
var keys = function keys(value) {
|
|
230
|
+
if (!value) return [];
|
|
231
|
+
var _getKeys = function getKeys(nested, paths) {
|
|
232
|
+
if (isObject(nested)) {
|
|
233
|
+
return Object.entries(nested).flatMap(function (_ref4) {
|
|
234
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
235
|
+
k = _ref5[0],
|
|
236
|
+
v = _ref5[1];
|
|
237
|
+
return _getKeys(v, [].concat(_toConsumableArray(paths), [k]));
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
if (isArray(nested)) {
|
|
241
|
+
return nested.flatMap(function (item, i) {
|
|
242
|
+
return _getKeys(item, [].concat(_toConsumableArray(paths), ["".concat(i)]));
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
return [paths.join(".")];
|
|
246
|
+
};
|
|
247
|
+
return _getKeys(value, []);
|
|
248
|
+
};
|
|
249
|
+
var symbolProto = Symbol ? Symbol.prototype : undefined;
|
|
250
|
+
var symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
251
|
+
var INFINITY = 1 / 0;
|
|
252
|
+
function isBoolean(value) {
|
|
253
|
+
return value === true || value === false;
|
|
254
|
+
}
|
|
255
|
+
function isObjectLike(value) {
|
|
256
|
+
return value != null && _typeof(value) == 'object';
|
|
257
|
+
}
|
|
258
|
+
function isNull(value) {
|
|
259
|
+
return value === null;
|
|
260
|
+
}
|
|
261
|
+
function isNil(value) {
|
|
262
|
+
return value == null;
|
|
263
|
+
}
|
|
264
|
+
function toString(value) {
|
|
265
|
+
return value == null ? '' : baseToString(value);
|
|
266
|
+
}
|
|
267
|
+
function baseToString(value) {
|
|
268
|
+
// Exit early for strings to avoid a performance hit in some environments.
|
|
269
|
+
if (typeof value == 'string') {
|
|
270
|
+
return value;
|
|
271
|
+
}
|
|
272
|
+
if (isArray(value)) {
|
|
273
|
+
// Recursively convert values (susceptible to call stack limits).
|
|
274
|
+
return arrayMap(value, baseToString) + '';
|
|
275
|
+
}
|
|
276
|
+
if (isSymbol(value)) {
|
|
277
|
+
return symbolToString ? symbolToString.call(value) : '';
|
|
278
|
+
}
|
|
279
|
+
var result = value + '';
|
|
280
|
+
return result == '0' && 1 / value == -INFINITY ? '-0' : result;
|
|
281
|
+
}
|
|
282
|
+
function arrayMap(array, iteratee) {
|
|
283
|
+
var index = -1,
|
|
284
|
+
length = array == null ? 0 : array.length,
|
|
285
|
+
result = Array(length);
|
|
286
|
+
while (++index < length) {
|
|
287
|
+
result[index] = iteratee(array[index], index, array);
|
|
288
|
+
}
|
|
289
|
+
return result;
|
|
290
|
+
}
|
|
291
|
+
function cloneDeep(value) {
|
|
292
|
+
try {
|
|
293
|
+
return JSON.parse(JSON.stringify(value));
|
|
294
|
+
} catch (error) {
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
function safe_json_parse(str) {
|
|
299
|
+
var retOnErr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
300
|
+
if (!str) return retOnErr;
|
|
301
|
+
if (_typeof(str) === 'object') return str;
|
|
302
|
+
if (!isString(str)) return retOnErr;
|
|
303
|
+
try {
|
|
304
|
+
var v = JSON.parse(str);
|
|
305
|
+
return isObject(v) || Array.isArray(v) ? v : retOnErr;
|
|
306
|
+
} catch (error) {
|
|
307
|
+
return retOnErr;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
function safe_json_stringify(obj) {
|
|
311
|
+
return JSON.stringify(obj);
|
|
312
|
+
}
|
|
313
|
+
function safe_json_parse_arr(str) {
|
|
314
|
+
var retOnErr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
315
|
+
if (!str) return retOnErr;
|
|
316
|
+
if (Array.isArray(str)) return str;
|
|
317
|
+
if (!isString(str)) return retOnErr;
|
|
318
|
+
try {
|
|
319
|
+
var v = JSON.parse(str);
|
|
320
|
+
return Array.isArray(v) ? v : retOnErr;
|
|
321
|
+
} catch (error) {
|
|
322
|
+
return retOnErr;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/******************************************************************************
|
|
327
|
+
Copyright (c) Microsoft Corporation.
|
|
328
|
+
|
|
329
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
330
|
+
purpose with or without fee is hereby granted.
|
|
331
|
+
|
|
332
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
333
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
334
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
335
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
336
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
337
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
338
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
339
|
+
***************************************************************************** */
|
|
340
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
341
|
+
function adopt(value) {
|
|
342
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
343
|
+
resolve(value);
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
347
|
+
function fulfilled(value) {
|
|
348
|
+
try {
|
|
349
|
+
step(generator.next(value));
|
|
350
|
+
} catch (e) {
|
|
351
|
+
reject(e);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
function rejected(value) {
|
|
355
|
+
try {
|
|
356
|
+
step(generator["throw"](value));
|
|
357
|
+
} catch (e) {
|
|
358
|
+
reject(e);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
function step(result) {
|
|
362
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
363
|
+
}
|
|
364
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
368
|
+
var e = new Error(message);
|
|
369
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
370
|
+
};
|
|
371
|
+
function sleep(sec) {
|
|
372
|
+
return new Promise(function (resolve) {
|
|
373
|
+
return setTimeout(resolve, sec * 1000);
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
function getSearchParamsValue(key) {
|
|
377
|
+
var _a, _b;
|
|
378
|
+
var url = new URL(location.toString());
|
|
379
|
+
return (_b = (_a = url === null || url === void 0 ? void 0 : url.searchParams) === null || _a === void 0 ? void 0 : _a.get(key)) !== null && _b !== void 0 ? _b : null;
|
|
380
|
+
}
|
|
381
|
+
function getSearchParamsAll(url) {
|
|
382
|
+
var _url = url !== null && url !== void 0 ? url : new URL(location.href);
|
|
383
|
+
var searchParams = _url ? _toConsumableArray(_url.searchParams.entries()).reduce(function (a, b) {
|
|
384
|
+
return Object.assign(a, _defineProperty({}, b[0], b[1]));
|
|
385
|
+
}, {}) : {};
|
|
386
|
+
return searchParams;
|
|
387
|
+
}
|
|
388
|
+
function scrollIntoView(symbol) {
|
|
389
|
+
var finder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.querySelector.bind(document);
|
|
390
|
+
var dom = finder(symbol);
|
|
391
|
+
var scrollIntoViewIfNeeded = dom === null || dom === void 0 ? void 0 : dom.scrollIntoViewIfNeeded;
|
|
392
|
+
if (scrollIntoViewIfNeeded) {
|
|
393
|
+
scrollIntoViewIfNeeded.call(dom);
|
|
394
|
+
} else {
|
|
395
|
+
dom === null || dom === void 0 ? void 0 : dom.scrollIntoView({
|
|
396
|
+
behavior: 'smooth'
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
function base64ToBinary(data, type) {
|
|
401
|
+
var raw = window.atob(data);
|
|
402
|
+
var uInt8Array = new Uint8Array(raw.length);
|
|
403
|
+
for (var i = 0; i < raw.length; i++) {
|
|
404
|
+
uInt8Array[i] = raw.charCodeAt(i);
|
|
405
|
+
}
|
|
406
|
+
return new Blob([uInt8Array], {
|
|
407
|
+
type: type
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
function downloadFile(content) {
|
|
411
|
+
var filename = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '问卷答题情况.xlsx';
|
|
412
|
+
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'application/vnd.ms-excel';
|
|
413
|
+
var isBase64 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
414
|
+
var eleLink = document.createElement('a');
|
|
415
|
+
eleLink.download = filename;
|
|
416
|
+
eleLink.style.display = 'none';
|
|
417
|
+
var blob = typeof content === 'string' ? isBase64 ? base64ToBinary(content, type) : new Blob([content], {
|
|
418
|
+
type: type
|
|
419
|
+
}) : content;
|
|
420
|
+
eleLink.href = URL.createObjectURL(blob);
|
|
421
|
+
document.body.appendChild(eleLink);
|
|
422
|
+
eleLink.click();
|
|
423
|
+
document.body.removeChild(eleLink);
|
|
424
|
+
}
|
|
425
|
+
function uuid() {
|
|
426
|
+
var temp_url = URL.createObjectURL(new Blob());
|
|
427
|
+
var uuid = temp_url.toString();
|
|
428
|
+
URL.revokeObjectURL(temp_url);
|
|
429
|
+
return uuid.slice(uuid.lastIndexOf("/") + 1);
|
|
430
|
+
}
|
|
431
|
+
function randomHex() {
|
|
432
|
+
var hex = ~~(Math.random() * 16);
|
|
433
|
+
return hex;
|
|
434
|
+
}
|
|
435
|
+
function charToUTF8(_char) {
|
|
436
|
+
var encoder = new TextEncoder();
|
|
437
|
+
var uint8Array = encoder.encode(_char[0]);
|
|
438
|
+
return Array.from(uint8Array);
|
|
439
|
+
}
|
|
440
|
+
function charToUnicode(_char2) {
|
|
441
|
+
// ES6 之后可以用 String.prototype.codePointAt() 从字符返回对应的码点
|
|
442
|
+
var u = _char2.charCodeAt(0);
|
|
443
|
+
var u1 = _char2.charCodeAt(0);
|
|
444
|
+
var u2 = _char2.charCodeAt(1);
|
|
445
|
+
if (u1 >= 0xD800 && u1 <= 0xDBFF && u2 >= 0xDC00 && u2 <= 0xDFFF) {
|
|
446
|
+
u = (u1 - 0xD800 << 10 | u2 - 0xDC00) + 0x10000;
|
|
447
|
+
}
|
|
448
|
+
return u;
|
|
449
|
+
}
|
|
450
|
+
// 先转 utf-8 再 decode
|
|
451
|
+
function unicodeToChar(u) {
|
|
452
|
+
var arr = unicode_to_UTF8(u);
|
|
453
|
+
if (!arr) return null;
|
|
454
|
+
var decoder = new TextDecoder();
|
|
455
|
+
var ui8 = new Uint8Array(arr);
|
|
456
|
+
return decoder.decode(ui8);
|
|
457
|
+
}
|
|
458
|
+
function unicode_to_UTF8(u) {
|
|
459
|
+
var arr = null; //utf8;
|
|
460
|
+
if (u <= 0x7F) {
|
|
461
|
+
arr = [u & 0xFF];
|
|
462
|
+
} else if (u <= 0x07FF) {
|
|
463
|
+
arr = [u >> 6 & 0x1F | 0xC0, u & 0x3F | 0x80];
|
|
464
|
+
} else if (u <= 0xFFFF) {
|
|
465
|
+
arr = [u >> 12 & 0x0F | 0xE0, u >> 6 & 0x3F | 0x80, u & 0x3F | 0x80];
|
|
466
|
+
} else if (u <= 0x10FFFF) {
|
|
467
|
+
arr = [u >> 18 & 0x07 | 0xF0, u >> 12 & 0x3F | 0x80, u >> 6 & 0x3F | 0x80, u & 0x3F | 0x80];
|
|
468
|
+
}
|
|
469
|
+
if (!arr) return null;
|
|
470
|
+
return arr;
|
|
471
|
+
}
|
|
472
|
+
function getFilledArray(n) {
|
|
473
|
+
return Array(n).fill(0);
|
|
474
|
+
}
|
|
475
|
+
function copyText(text) {
|
|
476
|
+
var textareaC = document.createElement('textarea');
|
|
477
|
+
textareaC.setAttribute('readonly', 'readonly');
|
|
478
|
+
textareaC.value = text;
|
|
479
|
+
document.body.appendChild(textareaC);
|
|
480
|
+
textareaC.select();
|
|
481
|
+
var res = document.execCommand('copy');
|
|
482
|
+
document.body.removeChild(textareaC);
|
|
483
|
+
console.log("复制成功");
|
|
484
|
+
return res;
|
|
485
|
+
}
|
|
486
|
+
function safeExec(fn) {
|
|
487
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
488
|
+
args[_key - 1] = arguments[_key];
|
|
489
|
+
}
|
|
490
|
+
return isFunction(fn) ? fn.apply(void 0, args) : null;
|
|
491
|
+
}
|
|
492
|
+
function safeGetFromFuncOrData(fn) {
|
|
493
|
+
var _a;
|
|
494
|
+
return (_a = safeExec(fn)) !== null && _a !== void 0 ? _a : fn;
|
|
495
|
+
}
|
|
496
|
+
function numberLikeCompare(a, b) {
|
|
497
|
+
if (a === b) return true;
|
|
498
|
+
if (isNil(a) || isNil(b)) return false;
|
|
499
|
+
if (isObject(a) || isObject(b)) return false;
|
|
500
|
+
if (isBoolean(a) && !isBoolean(b)) return false;
|
|
501
|
+
if (isBoolean(b) && !isBoolean(a)) return false;
|
|
502
|
+
if (toInt(a) === toInt(b)) return true;
|
|
503
|
+
if (toFloat(a) === toFloat(b)) return true;
|
|
504
|
+
if (toString(a) === toString(b)) return true;
|
|
505
|
+
return false;
|
|
506
|
+
}
|
|
507
|
+
function warpBase64Type(str, type) {
|
|
508
|
+
if (!str) return str;
|
|
509
|
+
if (type === 'img') {
|
|
510
|
+
return str.startsWith('data:image/png;base64,') ? str : "data:image/png;base64,".concat(str);
|
|
511
|
+
}
|
|
512
|
+
if (type === 'pdf') {
|
|
513
|
+
return str.startsWith('data:application/json;base64,') ? str : "data:application/json;base64,".concat(str);
|
|
514
|
+
}
|
|
515
|
+
return str;
|
|
516
|
+
}
|
|
517
|
+
function safe_number_parse(value) {
|
|
518
|
+
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NaN;
|
|
519
|
+
if (isNumber(value) && !isNaN(value)) return value;
|
|
520
|
+
var rawParse = Number(value);
|
|
521
|
+
return isNaN(rawParse) ? defaultValue : rawParse;
|
|
522
|
+
}
|
|
523
|
+
function expect_array(value) {
|
|
524
|
+
if (!Array.isArray(value)) return [];
|
|
525
|
+
return value;
|
|
526
|
+
}
|
|
527
|
+
// 生成包含字符的 svg 转义字符串
|
|
528
|
+
function gen_encoded_char_svg(props) {
|
|
529
|
+
var _char3 = props["char"],
|
|
530
|
+
_props$size = props.size,
|
|
531
|
+
size = _props$size === void 0 ? 12 : _props$size,
|
|
532
|
+
_props$color = props.color,
|
|
533
|
+
color = _props$color === void 0 ? 'cc0000' : _props$color;
|
|
534
|
+
var _color = (color === null || color === void 0 ? void 0 : color.startsWith('#')) ? color.slice(1) : color;
|
|
535
|
+
return "data:image/svg+xml,%3Csvg \n width='".concat(size + 2, "' height='").concat(size + 2, "' \n xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='50%25' y='50%25' \n font-size='").concat(size, "' \n fill='%23").concat(_color, "' \n font-weight='bold'\n text-anchor='middle' \n dominant-baseline='middle'%3E").concat(_char3, "%3C/text%3E%3C/svg%3E");
|
|
536
|
+
}
|
|
537
|
+
function base64_to_image(base64img) {
|
|
538
|
+
return new Promise(function (res, rej) {
|
|
539
|
+
if (!base64img) res(null);
|
|
540
|
+
var img = new Image();
|
|
541
|
+
img.onload = function () {
|
|
542
|
+
res(img);
|
|
543
|
+
};
|
|
544
|
+
img.src = base64img;
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
function image_to_base64(img_el) {
|
|
548
|
+
if (!img_el) return null;
|
|
549
|
+
var c = document.createElement('canvas');
|
|
550
|
+
c.width = img_el.width;
|
|
551
|
+
c.height = img_el.height;
|
|
552
|
+
var ctx = c.getContext('2d');
|
|
553
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(img_el, 0, 0, img_el.width, img_el.height);
|
|
554
|
+
var base64 = c.toDataURL('image/png');
|
|
555
|
+
return base64;
|
|
556
|
+
}
|
|
557
|
+
function filter_obj_to_url_search(obj) {
|
|
558
|
+
if (!obj) return {};
|
|
559
|
+
var clone_one = {};
|
|
560
|
+
keys(obj).forEach(function (k) {
|
|
561
|
+
var v = obj[k];
|
|
562
|
+
if (isNumber(v) || isBoolean(v) || isString(v) || isNull(v)) {
|
|
563
|
+
clone_one[k] = v;
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
return clone_one;
|
|
567
|
+
}
|
|
568
|
+
function safe_async_call(cb) {
|
|
569
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
570
|
+
args[_key2 - 1] = arguments[_key2];
|
|
571
|
+
}
|
|
572
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
573
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
574
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
575
|
+
case 0:
|
|
576
|
+
if (isFunction(cb)) {
|
|
577
|
+
_context2.next = 2;
|
|
578
|
+
break;
|
|
579
|
+
}
|
|
580
|
+
return _context2.abrupt("return", null);
|
|
581
|
+
case 2:
|
|
582
|
+
_context2.next = 4;
|
|
583
|
+
return Promise.resolve(cb.apply(void 0, args));
|
|
584
|
+
case 4:
|
|
585
|
+
return _context2.abrupt("return", _context2.sent);
|
|
586
|
+
case 5:
|
|
587
|
+
case "end":
|
|
588
|
+
return _context2.stop();
|
|
589
|
+
}
|
|
590
|
+
}, _callee2);
|
|
591
|
+
}));
|
|
592
|
+
}
|
|
593
|
+
window.safe_async_call = safe_async_call;
|
|
594
|
+
var global_cache_map = {};
|
|
595
|
+
function cache_fetch(key, cb) {
|
|
596
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
597
|
+
var _a, conf;
|
|
598
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
599
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
600
|
+
case 0:
|
|
601
|
+
conf = global_cache_map[key] = (_a = global_cache_map[key]) !== null && _a !== void 0 ? _a : {};
|
|
602
|
+
if (!conf.cache) {
|
|
603
|
+
_context3.next = 3;
|
|
604
|
+
break;
|
|
605
|
+
}
|
|
606
|
+
return _context3.abrupt("return", conf.cache);
|
|
607
|
+
case 3:
|
|
608
|
+
if (!conf.cache_promise) {
|
|
609
|
+
_context3.next = 5;
|
|
610
|
+
break;
|
|
611
|
+
}
|
|
612
|
+
return _context3.abrupt("return", conf.cache_promise);
|
|
613
|
+
case 5:
|
|
614
|
+
return _context3.abrupt("return", conf.cache_promise = cb().then(function (r) {
|
|
615
|
+
return conf.cache = r;
|
|
616
|
+
}));
|
|
617
|
+
case 6:
|
|
618
|
+
case "end":
|
|
619
|
+
return _context3.stop();
|
|
620
|
+
}
|
|
621
|
+
}, _callee3);
|
|
622
|
+
}));
|
|
623
|
+
}
|
|
624
|
+
function speculate_on_display(value) {
|
|
625
|
+
if (!value) return '';
|
|
626
|
+
if (isNumber(value)) return value + '';
|
|
627
|
+
if (Array.isArray(value)) {
|
|
628
|
+
var item0 = value[0];
|
|
629
|
+
return (item0 === null || item0 === void 0 ? void 0 : item0.label) || (item0 === null || item0 === void 0 ? void 0 : item0.value);
|
|
630
|
+
}
|
|
631
|
+
if (isObjectLike(value)) {
|
|
632
|
+
return value.label || value.value;
|
|
633
|
+
}
|
|
634
|
+
if (isString(value)) {
|
|
635
|
+
var obj = safe_json_parse(value);
|
|
636
|
+
return speculate_on_display(obj) || value;
|
|
637
|
+
}
|
|
638
|
+
return '';
|
|
639
|
+
}
|
|
640
|
+
// 00:00 00:05 ... 23:55
|
|
641
|
+
function getFuckTimeInterval() {
|
|
642
|
+
var star_hour = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
643
|
+
var end_hour = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 24;
|
|
644
|
+
var min_interval = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
|
|
645
|
+
return Array(end_hour - star_hour).fill(0).map(function (_, hour) {
|
|
646
|
+
var hour_str = (hour + star_hour).toString().padStart(2, '0');
|
|
647
|
+
var min_counts = 60 / min_interval;
|
|
648
|
+
return Array(min_counts).fill(0).map(function (_, min) {
|
|
649
|
+
var min_str = (min * min_interval).toString().padStart(2, '0');
|
|
650
|
+
return "".concat(hour_str, ":").concat(min_str);
|
|
651
|
+
});
|
|
652
|
+
}).flat();
|
|
653
|
+
}
|
|
654
|
+
// export function getTimeSlice(hour = 24, isShowSecond = false) {
|
|
655
|
+
// const hourArr = Array(hour).fill(0) as number[]
|
|
656
|
+
// const minuteArr = Array(60).fill(0) as number[]
|
|
657
|
+
// return hourArr.reduce((sum, h, hIdx) => {
|
|
658
|
+
// return [...sum, ...minuteArr.map((m, mIdx) => `${hIdx}:${mIdx}`)]
|
|
659
|
+
// }, [] as string[])
|
|
660
|
+
// }
|
|
661
|
+
var word = [['abundant', ' 丰富的', '/əˈbʌndənt/'], ['eloquent', ' 雄辩的', '/ˈeləkwənt/'], ['meticulous', ' 细致的', '/məˈtɪkjʊləs/'], ['resilient', ' 有韧性的', '/rɪˈzɪliənt/'], ['versatile', ' 多才多艺的', '/ˈvɜːsətaɪl/'], ['pragmatic', ' 务实的', '/præɡˈmætɪk/'], ['inevitable', ' 不可避免的', '/ɪˈnevɪtəbl/'], ['ambiguous', ' 模棱两可的', '/æmˈbɪɡjuəs/'], ['spontaneous', ' 自发的', '/spɒnˈteɪniəs/'], ['conscientious', ' 认真的', '/ˌkɒnʃiˈenʃəs/'], ['impeccable', ' 无瑕疵的', '/ɪmˈpekəbl/'], ['tenacious', ' 顽强的', '/təˈneɪʃəs/'], ['prolific', ' 多产的', '/prəˈlɪfɪk/']];
|
|
662
|
+
function random_word() {
|
|
663
|
+
return word[Math.random() * word.length | 0];
|
|
664
|
+
}
|
|
665
|
+
function confirm_operation() {
|
|
666
|
+
var word = random_word();
|
|
667
|
+
return prompt("\u8BF7\u8F93\u5165 ".concat(word[0], "\uFF08").concat(word[2], " adj.").concat(word[1], "\uFF09 \u4EE5\u786E\u8BA4\u4F60\u7684\u64CD\u4F5C")) === word[0];
|
|
668
|
+
}
|
|
669
|
+
// ES6 新增的方法
|
|
670
|
+
// '😎'.charCodeAt(0).toString(16) == 'd83d' // UTF-16 码元
|
|
671
|
+
// '😎'.charCodeAt(1).toString(16) == 'de0e'
|
|
672
|
+
// '😎'.codePointAt(0)?.toString(16) == '1f60e'// Unicode 码点
|
|
673
|
+
|
|
674
|
+
function getFn(format) {
|
|
675
|
+
return Object.assign(function (s) {
|
|
676
|
+
if (isFunction(s === null || s === void 0 ? void 0 : s.format)) {
|
|
677
|
+
var res = s.format(format);
|
|
678
|
+
if (isString(res)) return res;
|
|
679
|
+
}
|
|
680
|
+
var a = dayjs(s);
|
|
681
|
+
return a.isValid() ? a.format(format) : null;
|
|
682
|
+
}, {
|
|
683
|
+
format: format
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
function getMomentObj(s) {
|
|
687
|
+
return dayjs(s);
|
|
688
|
+
}
|
|
689
|
+
var formatDate = getFn('YYYY-MM-DD');
|
|
690
|
+
var formatDateTime = getFn('YYYY-MM-DD HH:mm:ss');
|
|
691
|
+
var formatDateTimeNoSecond = getFn('YYYY-MM-DD HH:mm');
|
|
692
|
+
var formatTime = getFn('HH:mm:ss');
|
|
693
|
+
function getMomentRange() {
|
|
694
|
+
var m = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : dayjs;
|
|
695
|
+
return {
|
|
696
|
+
昨天: [m().add(-1, 'day'), m().add(-1, 'day')],
|
|
697
|
+
今天: [m(), m()],
|
|
698
|
+
明天: [m().add(1, 'day'), m().add(1, 'day')],
|
|
699
|
+
上周: [m().add(-1, 'week').startOf('week'), m().add(-1, 'week').endOf('week')],
|
|
700
|
+
这周: [m().startOf('week'), m().endOf('week')],
|
|
701
|
+
下周: [m().add(1, 'week').startOf('week'), m().add(1, 'week').endOf('week')],
|
|
702
|
+
上月: [m().add(-1, 'month').startOf('month'), m().add(-1, 'month').endOf('month')],
|
|
703
|
+
这月: [m().startOf('month'), m().endOf('month')],
|
|
704
|
+
下月: [m().add(1, 'month').startOf('month'), m().add(1, 'month').endOf('month')],
|
|
705
|
+
今年: [m().startOf('year'), m().endOf('year')]
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
function isMoment(m) {
|
|
709
|
+
return isFunction(m.format);
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* 获取若干天后的日期
|
|
713
|
+
*/
|
|
714
|
+
function getFutureDate(num) {
|
|
715
|
+
return dayjs().add(num, 'days').format('YYYY-MM-DD');
|
|
716
|
+
}
|
|
717
|
+
function dayjs_quarter(input, which_quarter) {
|
|
718
|
+
if (typeof which_quarter !== 'undefined') {
|
|
719
|
+
// 设置季度:调整月份至目标季度的第一个月,并保持其他部分不变
|
|
720
|
+
var targetMonth = (which_quarter - 1) * 3;
|
|
721
|
+
var adjustedDate = input.month(targetMonth);
|
|
722
|
+
return [adjustedDate, which_quarter];
|
|
723
|
+
} else {
|
|
724
|
+
// 获取当前季度:根据月份计算季度(1-4)
|
|
725
|
+
var currentMonth = input.month(); // 0-11
|
|
726
|
+
var currentQuarter = Math.floor(currentMonth / 3) + 1;
|
|
727
|
+
return [input, currentQuarter];
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
var colorMap = {
|
|
731
|
+
'log': '#1475b2',
|
|
732
|
+
'warn': '#f89c1e',
|
|
733
|
+
'error': '#ed7961'
|
|
734
|
+
};
|
|
735
|
+
var big_txt_style = 'color:#1772F6;font-weight:bold;font-size:6em;padding:10px 20%;text-shadow:0.7px -1px 0 rgb(255 255 255 / 100%),1.4px -2px 0 rgb(255 255 255 / 96%),2px -3px 0 rgb(255 255 255 / 92%),2.8px -4px 0 rgb(255 255 255 / 88%),-1px 1px 2px rgb(0 0 0 / 70%),-2px 2px 4px rgb(0 0 0 / 70%),-3px 3px 6px rgb(0 0 0 / 70%);background: linear-gradient(to right top,oklab(58.2% -0.04 -0.21),oklab(58.2% -0.376 -0.21));';
|
|
736
|
+
var MyLog = /*#__PURE__*/function () {
|
|
737
|
+
function MyLog(e) {
|
|
738
|
+
_classCallCheck(this, MyLog);
|
|
739
|
+
Object.defineProperty(this, "env", {
|
|
740
|
+
enumerable: true,
|
|
741
|
+
configurable: true,
|
|
742
|
+
writable: true,
|
|
743
|
+
value: void 0
|
|
744
|
+
});
|
|
745
|
+
this.env = e;
|
|
746
|
+
}
|
|
747
|
+
return _createClass(MyLog, [{
|
|
748
|
+
key: "_logMsg",
|
|
749
|
+
value: function _logMsg() {
|
|
750
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'log';
|
|
751
|
+
var _a;
|
|
752
|
+
var fn = (_a = MyLog._handler) === null || _a === void 0 ? void 0 : _a[type];
|
|
753
|
+
if (!fn || !isFunction(fn)) return;
|
|
754
|
+
for (var _len3 = arguments.length, msg = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
755
|
+
msg[_key3 - 1] = arguments[_key3];
|
|
756
|
+
}
|
|
757
|
+
fn.apply(void 0, ["%c ".concat(this.env, " %c ").concat(formatDateTime(), " "), "padding: 1px; border-radius:3px 0 0 3px; color: #fff; background: ".concat(colorMap[type], ";"), "padding: 1px; border-radius: 0 3px 3px 0; color: #fff; background: #606060;"].concat(msg));
|
|
758
|
+
}
|
|
759
|
+
}, {
|
|
760
|
+
key: "logBig",
|
|
761
|
+
value: function logBig(t) {
|
|
762
|
+
var _a;
|
|
763
|
+
var fn = (_a = MyLog._handler) === null || _a === void 0 ? void 0 : _a.log;
|
|
764
|
+
if (!fn || !isFunction(fn)) return;
|
|
765
|
+
fn("%c".concat(t), big_txt_style);
|
|
766
|
+
}
|
|
767
|
+
}, {
|
|
768
|
+
key: "log",
|
|
769
|
+
value: function log() {
|
|
770
|
+
for (var _len4 = arguments.length, msg = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
771
|
+
msg[_key4] = arguments[_key4];
|
|
772
|
+
}
|
|
773
|
+
this._logMsg.apply(this, ['log'].concat(msg));
|
|
774
|
+
}
|
|
775
|
+
}, {
|
|
776
|
+
key: "warn",
|
|
777
|
+
value: function warn() {
|
|
778
|
+
for (var _len5 = arguments.length, msg = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
779
|
+
msg[_key5] = arguments[_key5];
|
|
780
|
+
}
|
|
781
|
+
this._logMsg.apply(this, ['warn'].concat(msg));
|
|
782
|
+
}
|
|
783
|
+
}, {
|
|
784
|
+
key: "error",
|
|
785
|
+
value: function error() {
|
|
786
|
+
for (var _len6 = arguments.length, msg = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
787
|
+
msg[_key6] = arguments[_key6];
|
|
788
|
+
}
|
|
789
|
+
this._logMsg.apply(this, ['error'].concat(msg));
|
|
790
|
+
}
|
|
791
|
+
}], [{
|
|
792
|
+
key: "handler",
|
|
793
|
+
set: function set(v) {
|
|
794
|
+
if (!v) return;
|
|
795
|
+
MyLog._handler = Object.assign(Object.assign({}, MyLog._handler), v);
|
|
796
|
+
}
|
|
797
|
+
}]);
|
|
798
|
+
}();
|
|
799
|
+
Object.defineProperty(MyLog, "_handler", {
|
|
800
|
+
enumerable: true,
|
|
801
|
+
configurable: true,
|
|
802
|
+
writable: true,
|
|
803
|
+
value: console
|
|
804
|
+
});
|
|
805
|
+
MyLog.handler = console;
|
|
806
|
+
var EventEmitter = /*#__PURE__*/function () {
|
|
807
|
+
function EventEmitter() {
|
|
808
|
+
_classCallCheck(this, EventEmitter);
|
|
809
|
+
Object.defineProperty(this, "events", {
|
|
810
|
+
enumerable: true,
|
|
811
|
+
configurable: true,
|
|
812
|
+
writable: true,
|
|
813
|
+
value: {}
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
return _createClass(EventEmitter, [{
|
|
817
|
+
key: "addListener",
|
|
818
|
+
value: function addListener(event, listener) {
|
|
819
|
+
var existing = this.events[event];
|
|
820
|
+
if (!existing) {
|
|
821
|
+
this.events[event] = existing = [];
|
|
822
|
+
}
|
|
823
|
+
existing.includes(listener) || existing.push(listener);
|
|
824
|
+
return this;
|
|
825
|
+
}
|
|
826
|
+
}, {
|
|
827
|
+
key: "on",
|
|
828
|
+
value: function on(event, listener) {
|
|
829
|
+
// this.off(event, listener)
|
|
830
|
+
return this.addListener(event, listener);
|
|
831
|
+
}
|
|
832
|
+
}, {
|
|
833
|
+
key: "on_cb",
|
|
834
|
+
value: function on_cb(event, listener) {
|
|
835
|
+
// this.off(event, listener)
|
|
836
|
+
this.addListener(event, listener);
|
|
837
|
+
return listener;
|
|
838
|
+
}
|
|
839
|
+
}, {
|
|
840
|
+
key: "on_rm",
|
|
841
|
+
value: function on_rm(event, listener) {
|
|
842
|
+
var _this = this;
|
|
843
|
+
// this.off(event, listener)
|
|
844
|
+
this.addListener(event, listener);
|
|
845
|
+
return function () {
|
|
846
|
+
_this.off(event, listener);
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
}, {
|
|
850
|
+
key: "emit",
|
|
851
|
+
value: function emit(event) {
|
|
852
|
+
for (var _len7 = arguments.length, args = new Array(_len7 > 1 ? _len7 - 1 : 0), _key7 = 1; _key7 < _len7; _key7++) {
|
|
853
|
+
args[_key7 - 1] = arguments[_key7];
|
|
854
|
+
}
|
|
855
|
+
var existing = this.events[event];
|
|
856
|
+
// EventEmitter.logger.log({ event, args })
|
|
857
|
+
if (!existing) {
|
|
858
|
+
return false;
|
|
859
|
+
}
|
|
860
|
+
existing.forEach(function (fn) {
|
|
861
|
+
fn.apply(void 0, args);
|
|
862
|
+
});
|
|
863
|
+
return true;
|
|
864
|
+
}
|
|
865
|
+
}, {
|
|
866
|
+
key: "removeAllListeners",
|
|
867
|
+
value: function removeAllListeners(event) {
|
|
868
|
+
this.events[event] = [];
|
|
869
|
+
return this;
|
|
870
|
+
}
|
|
871
|
+
}, {
|
|
872
|
+
key: "off",
|
|
873
|
+
value: function off(event, listener) {
|
|
874
|
+
var existing = this.events[event];
|
|
875
|
+
if (!existing) {
|
|
876
|
+
return this;
|
|
877
|
+
}
|
|
878
|
+
var index = existing.findIndex(function (_) {
|
|
879
|
+
return _ === listener;
|
|
880
|
+
});
|
|
881
|
+
if (index < 0) {
|
|
882
|
+
return this;
|
|
883
|
+
}
|
|
884
|
+
existing.splice(index, 1);
|
|
885
|
+
return this;
|
|
886
|
+
}
|
|
887
|
+
}, {
|
|
888
|
+
key: "once",
|
|
889
|
+
value: function once(event, listener) {
|
|
890
|
+
var _this2 = this;
|
|
891
|
+
var _fn = function fn() {
|
|
892
|
+
listener.apply(void 0, arguments);
|
|
893
|
+
_this2.off(event, _fn);
|
|
894
|
+
};
|
|
895
|
+
this.on(event, _fn);
|
|
896
|
+
return this;
|
|
897
|
+
}
|
|
898
|
+
}, {
|
|
899
|
+
key: "prependListener",
|
|
900
|
+
value: function prependListener(event, listener) {
|
|
901
|
+
return this;
|
|
902
|
+
}
|
|
903
|
+
}, {
|
|
904
|
+
key: "prependOnceListener",
|
|
905
|
+
value: function prependOnceListener(event, listener) {
|
|
906
|
+
return this;
|
|
907
|
+
}
|
|
908
|
+
}, {
|
|
909
|
+
key: "removeListener",
|
|
910
|
+
value: function removeListener(event, listener) {
|
|
911
|
+
return this;
|
|
912
|
+
}
|
|
913
|
+
}, {
|
|
914
|
+
key: "setMaxListeners",
|
|
915
|
+
value: function setMaxListeners(n) {
|
|
916
|
+
return this;
|
|
917
|
+
}
|
|
918
|
+
}, {
|
|
919
|
+
key: "getMaxListeners",
|
|
920
|
+
value: function getMaxListeners() {
|
|
921
|
+
return 0;
|
|
922
|
+
}
|
|
923
|
+
}, {
|
|
924
|
+
key: "listeners",
|
|
925
|
+
value: function listeners(event) {
|
|
926
|
+
return [];
|
|
927
|
+
}
|
|
928
|
+
}, {
|
|
929
|
+
key: "rawListeners",
|
|
930
|
+
value: function rawListeners(event) {
|
|
931
|
+
return [];
|
|
932
|
+
}
|
|
933
|
+
}, {
|
|
934
|
+
key: "eventNames",
|
|
935
|
+
value: function eventNames() {
|
|
936
|
+
return [];
|
|
937
|
+
}
|
|
938
|
+
}, {
|
|
939
|
+
key: "listenerCount",
|
|
940
|
+
value: function listenerCount(type) {
|
|
941
|
+
return 0;
|
|
942
|
+
}
|
|
943
|
+
}]);
|
|
944
|
+
}();
|
|
945
|
+
Object.defineProperty(EventEmitter, "logger", {
|
|
946
|
+
enumerable: true,
|
|
947
|
+
configurable: true,
|
|
948
|
+
writable: true,
|
|
949
|
+
value: new MyLog('EventEmitter')
|
|
950
|
+
});
|
|
951
|
+
export { EventEmitter, MyLog, base64ToBinary, base64_to_image, cache_fetch, charToUTF8, charToUnicode, clone, cloneDeep, confirm_operation, copyText, dayjs_quarter, downloadFile, expect_array, filter_obj_to_url_search, formatDate, formatDateTime, formatDateTimeNoSecond, formatTime, gen_encoded_char_svg, get, getFilledArray, getFuckTimeInterval, getFutureDate, getMomentObj, getMomentRange, getSearchParamsAll, getSearchParamsValue, image_to_base64, isArray, isBoolean, _isEqual as isEqual, isFunction, isMoment, isNil, isNull, isNumber, isObject, isObjectLike, isString, isSymbol, keys, map, mapEntries, mapValues, numberLikeCompare, omit, pick, randomHex, random_word, safeExec, safeGetFromFuncOrData, safe_async_call, safe_json_parse, safe_json_parse_arr, safe_json_stringify, safe_number_parse, scrollIntoView, set, sleep, speculate_on_display, toFloat, toInt, toString, unicodeToChar, unicode_to_UTF8, unique, uuid, warpBase64Type };
|
package/dist/log.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface ILL {
|
|
2
|
+
log?(...optionalParams: any[]): void;
|
|
3
|
+
warn?(...optionalParams: any[]): void;
|
|
4
|
+
error?(...optionalParams: any[]): void;
|
|
5
|
+
}
|
|
6
|
+
export declare class MyLog {
|
|
7
|
+
private _logMsg;
|
|
8
|
+
logBig(t: string): void;
|
|
9
|
+
private env;
|
|
10
|
+
private static _handler;
|
|
11
|
+
static set handler(v: ILL);
|
|
12
|
+
constructor(e: string);
|
|
13
|
+
log(...msg: any[]): void;
|
|
14
|
+
warn(...msg: any[]): void;
|
|
15
|
+
error(...msg: any[]): void;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import dayjs, { Dayjs, ConfigType } from "dayjs";
|
|
2
|
+
type TOutput = dayjs.Dayjs;
|
|
3
|
+
export declare function getMomentObj(s: ConfigType): TOutput;
|
|
4
|
+
export declare const formatDate: ((s?: any) => any) & {
|
|
5
|
+
format: "YYYY-MM-DD";
|
|
6
|
+
};
|
|
7
|
+
export declare const formatDateTime: ((s?: any) => any) & {
|
|
8
|
+
format: "YYYY-MM-DD HH:mm:ss";
|
|
9
|
+
};
|
|
10
|
+
export declare const formatDateTimeNoSecond: ((s?: any) => any) & {
|
|
11
|
+
format: "YYYY-MM-DD HH:mm";
|
|
12
|
+
};
|
|
13
|
+
export declare const formatTime: ((s?: any) => any) & {
|
|
14
|
+
format: "HH:mm:ss";
|
|
15
|
+
};
|
|
16
|
+
export declare function getMomentRange(m?: any): {
|
|
17
|
+
昨天: [dayjs.Dayjs, dayjs.Dayjs];
|
|
18
|
+
今天: [dayjs.Dayjs, dayjs.Dayjs];
|
|
19
|
+
明天: [dayjs.Dayjs, dayjs.Dayjs];
|
|
20
|
+
上周: [dayjs.Dayjs, dayjs.Dayjs];
|
|
21
|
+
这周: [dayjs.Dayjs, dayjs.Dayjs];
|
|
22
|
+
下周: [dayjs.Dayjs, dayjs.Dayjs];
|
|
23
|
+
上月: [dayjs.Dayjs, dayjs.Dayjs];
|
|
24
|
+
这月: [dayjs.Dayjs, dayjs.Dayjs];
|
|
25
|
+
下月: [dayjs.Dayjs, dayjs.Dayjs];
|
|
26
|
+
今年: [dayjs.Dayjs, dayjs.Dayjs];
|
|
27
|
+
};
|
|
28
|
+
export declare function isMoment(m: any): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 获取若干天后的日期
|
|
31
|
+
*/
|
|
32
|
+
export declare function getFutureDate(num: number): any;
|
|
33
|
+
export declare function dayjs_quarter(input: Dayjs, which_quarter?: number): [Dayjs, number];
|
|
34
|
+
export { dayjs, Dayjs, };
|
|
35
|
+
export type Dayjs_ConfigType = ConfigType;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type TCommonFileType = 'application/vnd.ms-excel' | 'text/csv;charset=utf-8' | 'application/msword';
|
|
2
|
+
export declare function sleep(sec: number): Promise<void>;
|
|
3
|
+
export declare function getSearchParamsValue(key: string): string | null;
|
|
4
|
+
export declare function getSearchParamsAll(url?: URL): {
|
|
5
|
+
[x: string]: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function scrollIntoView(symbol: string, finder?: (selectors: string) => Element | null): void;
|
|
8
|
+
export declare function base64ToBinary(data: string, type: TCommonFileType): Blob;
|
|
9
|
+
export declare function downloadFile(content: string | Blob, filename?: string, type?: TCommonFileType, isBase64?: boolean): void;
|
|
10
|
+
export declare function uuid(): string;
|
|
11
|
+
export declare function randomHex(): number;
|
|
12
|
+
export declare function charToUTF8(char: string): number[];
|
|
13
|
+
export declare function charToUnicode(char: string): number;
|
|
14
|
+
export declare function unicodeToChar(u: number): string | null;
|
|
15
|
+
export declare function unicode_to_UTF8(u: number): number[] | null;
|
|
16
|
+
export declare function getFilledArray(n: number): any[];
|
|
17
|
+
export declare function copyText(text: string): boolean;
|
|
18
|
+
export declare function safeExec<T extends (...args: any) => any>(fn?: T, ...args: Parameters<T>[]): any;
|
|
19
|
+
export declare function safeGetFromFuncOrData(fn: any): any;
|
|
20
|
+
export declare function numberLikeCompare(a: number | string | boolean, b: number | string | boolean): boolean;
|
|
21
|
+
export declare function warpBase64Type(str: string, type: 'img' | 'pdf'): string;
|
|
22
|
+
export declare function safe_number_parse(value: any, defaultValue?: number): number;
|
|
23
|
+
export declare function expect_array<T>(value?: T[] | null): T[];
|
|
24
|
+
export declare function gen_encoded_char_svg(props: {
|
|
25
|
+
char: string;
|
|
26
|
+
size?: number;
|
|
27
|
+
color?: string;
|
|
28
|
+
}): string;
|
|
29
|
+
export declare function base64_to_image(base64img: string): Promise<HTMLImageElement | null>;
|
|
30
|
+
export declare function image_to_base64(img_el: HTMLImageElement): string | null;
|
|
31
|
+
export declare function filter_obj_to_url_search(obj: Object | any[]): any;
|
|
32
|
+
export declare function safe_async_call<T extends (...args: any) => any>(cb: T, ...args: Parameters<T>): Promise<ReturnType<T> | null>;
|
|
33
|
+
export declare function cache_fetch<T = any>(key: string, cb: () => Promise<T>): Promise<T>;
|
|
34
|
+
export declare function speculate_on_display(value?: any): string;
|
|
35
|
+
export declare function getFuckTimeInterval(star_hour?: number, end_hour?: number, min_interval?: 1 | 2 | 3 | 4 | 5 | 6 | 10 | 15 | 20 | 30): string[];
|
|
36
|
+
export declare function random_word(): string[];
|
|
37
|
+
export declare function confirm_operation(): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type PartialAll<T> = {
|
|
2
|
+
[P in keyof T]?: T[P] extends Array<any> ? Partial<T[P][number]>[] : Partial<T[P]>;
|
|
3
|
+
};
|
|
4
|
+
export type PartialSome<T, K extends keyof T> = {
|
|
5
|
+
[P in K]?: T[P];
|
|
6
|
+
} & Pick<T, Exclude<keyof T, K>>;
|
|
7
|
+
export type AnyObject<T = any> = {
|
|
8
|
+
[x: string]: T;
|
|
9
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@noah-libjs/utils",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
+
"build": "rollup -c rollup.config.js",
|
|
8
|
+
"build:watch": "rollup -c rollup.config.js --watch",
|
|
9
|
+
"clean": "rm dist -rf",
|
|
10
|
+
"prebuild": "pnpm clean"
|
|
11
|
+
},
|
|
12
|
+
"main": "dist/index.js",
|
|
13
|
+
"directories": {
|
|
14
|
+
"lib": "dist"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"radash": "^12.1.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"rollup": "^2.70.2"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"dayjs": "^1.11.13"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [],
|
|
32
|
+
"author": "",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"gitHead": "a9168af66dd5e2e5a7fbf61871e6cf05f29a0d15"
|
|
35
|
+
}
|