lyb-js 1.1.12 → 1.2.1
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/dist/Base/LibJsGetDataType/index.js +1 -1
- package/dist/Base/LibJsPromiseTimeout/index.js +9 -10
- package/dist/Browser/LibJsColorConsole/index.d.ts +1 -1
- package/dist/Browser/LibJsColorConsole/index.js +12 -25
- package/dist/Browser/LibJsIsMobile/index.js +2 -2
- package/dist/Browser/LibJsIsPad/index.js +8 -8
- package/dist/Browser/LibJsObjToUrlParams/index.js +2 -5
- package/dist/Browser/LibJsPathParams/index.js +5 -5
- package/dist/Browser/LibJsSetTitleIcon/index.js +3 -3
- package/dist/Browser/LibJsTagTitleTip/index.js +5 -5
- package/dist/Data/LibJsChunkArray/index.js +3 -3
- package/dist/Data/LibJsDeepJSONParse/index.js +4 -4
- package/dist/Data/LibJsGroupArrayByKey/index.js +2 -3
- package/dist/Data/LibJsMatchEmail/index.js +4 -4
- package/dist/Data/LibJsShuffleArray/index.js +5 -15
- package/dist/Data/LibJsStepArray/index.js +3 -3
- package/dist/Data/LibReverseArrayFromIndex/index.js +3 -12
- package/dist/File/LibJsDownloadImageLink/index.js +5 -5
- package/dist/File/LibJsImageOptimizer/index.js +36 -36
- package/dist/File/LibJsSaveJson/index.js +4 -4
- package/dist/Formatter/LibJsFormatterByte/index.js +6 -6
- package/dist/Formatter/LibJsMaskPhoneNumber/index.js +2 -2
- package/dist/Formatter/LibJsNumComma/index.js +3 -4
- package/dist/Formatter/LibJsNumberUnit/index.js +9 -15
- package/dist/Formatter/LibJsSecondsFormatterChinese/index.js +15 -15
- package/dist/Math/LibJsCalculateExpression/index.js +17 -19
- package/dist/Math/LibJsConvertAngle/index.js +1 -1
- package/dist/Math/LibJsCoordsAngle/index.js +5 -5
- package/dist/Math/LibJsCoordsDistance/index.js +4 -4
- package/dist/Math/LibJsDecimal/index.js +7 -8
- package/dist/Misc/LibJsRegFormValidate/index.js +6 -6
- package/dist/Misc/LibJsRetryRequest/index.js +6 -7
- package/dist/Misc/LibNumerStepper/index.js +17 -21
- package/dist/Random/LibJsProbabilityResult/index.js +1 -3
- package/dist/Random/LibJsRandom/index.js +1 -2
- package/dist/Random/LibJsRandomColor/index.js +5 -6
- package/dist/Random/LibJsUniqueRandomNumbers/index.js +5 -6
- package/dist/Time/LibJsSameTimeCheck/index.d.ts +1 -1
- package/dist/Time/LibJsSameTimeCheck/index.js +3 -3
- package/dist/Time/LibJsTimeAgo/index.js +7 -8
- package/dist/Time/LibJsTimeGreeting/index.js +3 -4
- package/dist/index.js +2 -1
- package/dist/libJs.d.ts +2 -2
- package/dist/libJs.js +48 -48
- package/package.json +3 -3
- package/umd/lyb.js +2 -2
|
@@ -5,32 +5,31 @@ import Decimal from "decimal.js";
|
|
|
5
5
|
* @returns 计算结果
|
|
6
6
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsCalculateExpression-表达式字符串
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
9
|
-
if (point === void 0) { point = 2; }
|
|
8
|
+
export const libJsCalculateExpression = (expression, point = 2) => {
|
|
10
9
|
//清除所有空格
|
|
11
10
|
expression = expression.replace(/\s+/g, "");
|
|
12
11
|
//支持的运算符和优先级
|
|
13
|
-
|
|
12
|
+
const operators = {
|
|
14
13
|
"+": 1,
|
|
15
14
|
"-": 1,
|
|
16
15
|
"*": 2,
|
|
17
16
|
"/": 2,
|
|
18
17
|
};
|
|
19
18
|
//支持的小数点精度
|
|
20
|
-
|
|
19
|
+
const toDecimal = (value) => new Decimal(value);
|
|
21
20
|
//判断字符是否是运算符
|
|
22
|
-
|
|
21
|
+
const isOperator = (char) => ["+", "-", "*", "/"].includes(char);
|
|
23
22
|
//判断字符是否是数字(包括小数点)
|
|
24
|
-
|
|
23
|
+
const isNumber = (char) => /[0-9.]/.test(char);
|
|
25
24
|
//解析表达式并计算
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const evaluate = (expression) => {
|
|
26
|
+
const outputQueue = []; //输出队列
|
|
27
|
+
const operatorStack = []; //操作符栈
|
|
28
|
+
let i = 0;
|
|
30
29
|
while (i < expression.length) {
|
|
31
|
-
|
|
30
|
+
const char = expression[i];
|
|
32
31
|
if (isNumber(char)) {
|
|
33
|
-
|
|
32
|
+
let numStr = "";
|
|
34
33
|
//处理多位数字(支持小数)
|
|
35
34
|
while (i < expression.length && isNumber(expression[i])) {
|
|
36
35
|
numStr += expression[i];
|
|
@@ -61,7 +60,7 @@ export var libJsCalculateExpression = function (expression, point) {
|
|
|
61
60
|
i++;
|
|
62
61
|
}
|
|
63
62
|
else {
|
|
64
|
-
throw new Error(
|
|
63
|
+
throw new Error(`无效字符: ${char}`);
|
|
65
64
|
}
|
|
66
65
|
}
|
|
67
66
|
//把所有剩余的操作符添加到输出队列
|
|
@@ -69,12 +68,11 @@ export var libJsCalculateExpression = function (expression, point) {
|
|
|
69
68
|
outputQueue.push(operatorStack.pop());
|
|
70
69
|
}
|
|
71
70
|
//执行运算
|
|
72
|
-
|
|
73
|
-
for (
|
|
74
|
-
var token = outputQueue_1[_i];
|
|
71
|
+
const calcStack = [];
|
|
72
|
+
for (let token of outputQueue) {
|
|
75
73
|
if (typeof token === "string") {
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
const b = calcStack.pop();
|
|
75
|
+
const a = calcStack.pop();
|
|
78
76
|
switch (token) {
|
|
79
77
|
case "+":
|
|
80
78
|
calcStack.push(a.add(b));
|
|
@@ -100,7 +98,7 @@ export var libJsCalculateExpression = function (expression, point) {
|
|
|
100
98
|
};
|
|
101
99
|
try {
|
|
102
100
|
//调用计算器并返回结果
|
|
103
|
-
|
|
101
|
+
const result = evaluate(expression);
|
|
104
102
|
return Number(result.toFixed(point)); //保留指定的小数位数
|
|
105
103
|
}
|
|
106
104
|
catch (error) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param type 角度类型或弧度类型
|
|
5
5
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsConvertAngle-角弧度互转
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export const libJsConvertAngle = (value, type) => {
|
|
8
8
|
if (type === "rad") {
|
|
9
9
|
return value * (Math.PI / 180);
|
|
10
10
|
}
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* @param coord2 终点坐标
|
|
4
4
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsCoordsAngle-两点角度
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export const libJsCoordsAngle = (coord1, coord2) => {
|
|
7
7
|
//计算相对于第一个坐标的水平和垂直距离
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const deltaX = coord2.x - coord1.x;
|
|
9
|
+
const deltaY = coord2.y - coord1.y;
|
|
10
10
|
//使用反三角函数计算角度(以弧度为单位)
|
|
11
|
-
|
|
11
|
+
const angleRad = Math.atan2(deltaY, deltaX);
|
|
12
12
|
//将弧度转换为角度
|
|
13
|
-
|
|
13
|
+
let angleDeg = angleRad * (180 / Math.PI);
|
|
14
14
|
//将角度转换为顺时针方向为正方向的角度
|
|
15
15
|
angleDeg = -angleDeg + 90;
|
|
16
16
|
//调整角度使得右边成为 360 度的位置变为 0 度
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* @param coord2 终点坐标
|
|
4
4
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsCoordsDistance-两点距离
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export const libJsCoordsDistance = (coord1, coord2) => {
|
|
7
7
|
//计算两个坐标之间的水平和垂直距离
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const deltaX = coord2.x - coord1.x;
|
|
9
|
+
const deltaY = coord2.y - coord1.y;
|
|
10
10
|
//使用勾股定理计算两点之间的距离
|
|
11
|
-
|
|
11
|
+
const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
12
12
|
return distance;
|
|
13
13
|
};
|
|
@@ -5,19 +5,18 @@ import { Decimal } from "decimal.js";
|
|
|
5
5
|
* @param operator 运算符,支持加减乘除
|
|
6
6
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsDecimal-高精度计算
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"/": function (a, b) {
|
|
8
|
+
export const libJsDecimal = (num1, num2, operator, point = 2) => {
|
|
9
|
+
const calc = {
|
|
10
|
+
"+": (a, b) => a.add(b),
|
|
11
|
+
"-": (a, b) => a.sub(b),
|
|
12
|
+
"*": (a, b) => a.mul(b),
|
|
13
|
+
"/": (a, b) => {
|
|
15
14
|
if (b.eq(0)) {
|
|
16
15
|
throw new Error("除数不能为0");
|
|
17
16
|
}
|
|
18
17
|
return a.div(b);
|
|
19
18
|
},
|
|
20
19
|
};
|
|
21
|
-
|
|
20
|
+
const result = calc[operator](new Decimal(num1), new Decimal(num2));
|
|
22
21
|
return Number(result.toFixed(point));
|
|
23
22
|
};
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
* @returns 验证结果数组,包含未通过验证的项
|
|
6
6
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsRegFormValidate-表单验证
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
9
|
-
return rules.reduce(
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
export const libJsRegFormValidate = (form, rules) => {
|
|
9
|
+
return rules.reduce((result, rule) => {
|
|
10
|
+
const { key, verify, msg, name } = rule;
|
|
11
|
+
const value = form[key];
|
|
12
12
|
if (value === "" || value === undefined || value === null) {
|
|
13
|
-
result.push({ key
|
|
13
|
+
result.push({ key, msg: "必填项", name });
|
|
14
14
|
}
|
|
15
15
|
else if (typeof verify === "function" ? !verify(value) : !verify.test(value)) {
|
|
16
|
-
result.push({ key
|
|
16
|
+
result.push({ key, msg, name });
|
|
17
17
|
}
|
|
18
18
|
return result;
|
|
19
19
|
}, []);
|
|
@@ -5,16 +5,15 @@
|
|
|
5
5
|
* @param params 请求参数
|
|
6
6
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsRetryRequest-请求重连
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var makeRequest = function () {
|
|
8
|
+
export const libJsRetryRequest = ({ promiseFn, maxRetries = 3, retryDelay = 2000, params = undefined, }) => {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
let count = 0;
|
|
11
|
+
const makeRequest = () => {
|
|
13
12
|
promiseFn(params)
|
|
14
|
-
.then(
|
|
13
|
+
.then((res) => {
|
|
15
14
|
resolve(res);
|
|
16
15
|
})
|
|
17
|
-
.catch(
|
|
16
|
+
.catch((err) => {
|
|
18
17
|
count++;
|
|
19
18
|
if (count >= maxRetries) {
|
|
20
19
|
reject(err);
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/** @description 数字步进器
|
|
2
2
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibNumerStepper-数字步进器
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
export class libNumerStepper {
|
|
5
5
|
/**
|
|
6
6
|
* @param numsLength 数字长度
|
|
7
7
|
* @param onChange 数字变动时触发
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
var _this = this;
|
|
9
|
+
constructor(numsLength, onChange) {
|
|
11
10
|
/** 当前按下状态 */
|
|
12
11
|
this._isDown = false;
|
|
13
12
|
/** 当前数字索引 */
|
|
@@ -16,35 +15,34 @@ var libNumerStepper = /** @class */ (function () {
|
|
|
16
15
|
this._numsLength = 0;
|
|
17
16
|
this._onChange = onChange;
|
|
18
17
|
this._numsLength = numsLength;
|
|
19
|
-
window.addEventListener("pointerup",
|
|
20
|
-
|
|
18
|
+
window.addEventListener("pointerup", () => {
|
|
19
|
+
this._isDown && this._up();
|
|
21
20
|
});
|
|
22
21
|
}
|
|
23
22
|
/** @description 按下 */
|
|
24
|
-
|
|
25
|
-
var _this = this;
|
|
23
|
+
down(type) {
|
|
26
24
|
this._isDown = true;
|
|
27
25
|
this._handleChange(type);
|
|
28
|
-
this._timerId = setTimeout(
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
this._timerId = setTimeout(() => {
|
|
27
|
+
if (this._isDown) {
|
|
28
|
+
this._intervalId = setInterval(() => {
|
|
29
|
+
this._handleChange(type);
|
|
32
30
|
}, 100);
|
|
33
31
|
}
|
|
34
32
|
}, 100);
|
|
35
|
-
}
|
|
33
|
+
}
|
|
36
34
|
/** @description 更新索引 */
|
|
37
|
-
|
|
35
|
+
updateIndex(index) {
|
|
38
36
|
this._currentIndex = index;
|
|
39
|
-
}
|
|
37
|
+
}
|
|
40
38
|
/** @description 抬起 */
|
|
41
|
-
|
|
39
|
+
_up() {
|
|
42
40
|
this._isDown = false;
|
|
43
41
|
clearTimeout(this._timerId);
|
|
44
42
|
clearInterval(this._intervalId);
|
|
45
|
-
}
|
|
43
|
+
}
|
|
46
44
|
/** @description 处理数字变化 */
|
|
47
|
-
|
|
45
|
+
_handleChange(type) {
|
|
48
46
|
if (type === "add") {
|
|
49
47
|
if (this._currentIndex < this._numsLength - 1) {
|
|
50
48
|
this._currentIndex++;
|
|
@@ -57,7 +55,5 @@ var libNumerStepper = /** @class */ (function () {
|
|
|
57
55
|
this._onChange(this._currentIndex);
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
}());
|
|
63
|
-
export { libNumerStepper };
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -2,6 +2,4 @@
|
|
|
2
2
|
* @param probability 触发概率,百分比,0-100
|
|
3
3
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsProbabilityResult-概率触发
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
return Math.random() * 100 < probability;
|
|
7
|
-
};
|
|
5
|
+
export const libJsProbabilityResult = (probability) => Math.random() * 100 < probability;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* @param num 保留小数位数
|
|
5
5
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsRandom-随机数
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
if (num === void 0) { num = 0; }
|
|
7
|
+
export const libJsRandom = (min, max, num = 0) => {
|
|
9
8
|
return parseFloat((Math.random() * (max - min) + min).toFixed(num));
|
|
10
9
|
};
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
* @param alpha 透明度
|
|
3
3
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsRandomColor-随机色
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alpha, ")");
|
|
5
|
+
export const libJsRandomColor = (alpha = 1) => {
|
|
6
|
+
const r = Math.floor(Math.random() * 256);
|
|
7
|
+
const g = Math.floor(Math.random() * 256);
|
|
8
|
+
const b = Math.floor(Math.random() * 256);
|
|
9
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
11
10
|
};
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
* @param count 数组长度
|
|
5
5
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsUniqueRandomNumbers-随机数数组
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
_a = [numbers[j], numbers[i]], numbers[i] = _a[0], numbers[j] = _a[1];
|
|
7
|
+
export const libJsUniqueRandomNumbers = (min, max, count) => {
|
|
8
|
+
const numbers = Array.from({ length: max - min + 1 }, (_, i) => i + min);
|
|
9
|
+
for (let i = numbers.length - 1; i > 0; i--) {
|
|
10
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
11
|
+
[numbers[i], numbers[j]] = [numbers[j], numbers[i]];
|
|
13
12
|
}
|
|
14
13
|
return numbers.slice(0, count);
|
|
15
14
|
};
|
|
@@ -6,4 +6,4 @@ import dayjs from "dayjs";
|
|
|
6
6
|
* @returns 0-同一单位时间 1-新单位时间 -1时间戳大于当前时间
|
|
7
7
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsSameTimeCheck-时间比对
|
|
8
8
|
*/
|
|
9
|
-
export declare const libJsSameTimeCheck: (timestamp: number, unit: dayjs.OpUnitType) =>
|
|
9
|
+
export declare const libJsSameTimeCheck: (timestamp: number, unit: dayjs.OpUnitType) => 1 | -1 | 0;
|
|
@@ -6,9 +6,9 @@ import dayjs from "dayjs";
|
|
|
6
6
|
* @returns 0-同一单位时间 1-新单位时间 -1时间戳大于当前时间
|
|
7
7
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsSameTimeCheck-时间比对
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export const libJsSameTimeCheck = (timestamp, unit) => {
|
|
10
|
+
const inputTime = dayjs(timestamp).startOf(unit);
|
|
11
|
+
const currentTime = dayjs().startOf(unit);
|
|
12
12
|
if (inputTime.isSame(currentTime)) {
|
|
13
13
|
return 0;
|
|
14
14
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @param timestamp 毫秒时间戳
|
|
3
3
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsTimeAgo-中文时间差
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
|
|
5
|
+
export const libJsTimeAgo = (timestamp) => {
|
|
6
|
+
const timeUnits = [
|
|
7
7
|
{ unit: "年", milliseconds: 365 * 24 * 60 * 60 * 1000 },
|
|
8
8
|
{ unit: "月", milliseconds: 30 * 24 * 60 * 60 * 1000 },
|
|
9
9
|
{ unit: "周", milliseconds: 7 * 24 * 60 * 60 * 1000 },
|
|
@@ -11,13 +11,12 @@ export var libJsTimeAgo = function (timestamp) {
|
|
|
11
11
|
{ unit: "小时", milliseconds: 60 * 60 * 1000 },
|
|
12
12
|
{ unit: "分钟", milliseconds: 60 * 1000 },
|
|
13
13
|
];
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
for (
|
|
17
|
-
var _a = timeUnits_1[_i], unit = _a.unit, milliseconds = _a.milliseconds;
|
|
14
|
+
const currentTime = Date.now();
|
|
15
|
+
const timeDifference = currentTime - timestamp;
|
|
16
|
+
for (const { unit, milliseconds } of timeUnits) {
|
|
18
17
|
if (timeDifference >= milliseconds) {
|
|
19
|
-
|
|
20
|
-
return
|
|
18
|
+
const count = Math.floor(timeDifference / milliseconds);
|
|
19
|
+
return `${count} ${unit}前`;
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
22
|
return "刚刚";
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
* @param greet 自定义问候语对象
|
|
4
4
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsTimeGreeting-时间问候
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var now = new Date().getHours();
|
|
6
|
+
export const libJsTimeGreeting = (greet = {}) => {
|
|
7
|
+
const { midnight = "午夜好", morning = "早上好", forenoon = "上午好", noon = "中午好", afternoon = "下午好", evening = "晚上好", } = greet;
|
|
8
|
+
const now = new Date().getHours();
|
|
10
9
|
return now < 4
|
|
11
10
|
? midnight
|
|
12
11
|
: now < 10
|
package/dist/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import * as LibJs_1 from "./libJs";
|
|
2
|
+
export { LibJs_1 as LibJs };
|
package/dist/libJs.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare const Browser: {
|
|
|
26
26
|
libJsColorConsole: (title: string, color: "red" | "orange" | "yellow" | "green" | "blue" | "purple", logs?: {
|
|
27
27
|
label: string;
|
|
28
28
|
value: any;
|
|
29
|
-
}[] | any
|
|
29
|
+
}[] | any) => void;
|
|
30
30
|
/** @description 判断是否为移动设备
|
|
31
31
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsIsMobile-判断手机
|
|
32
32
|
*/
|
|
@@ -280,7 +280,7 @@ export declare const Time: {
|
|
|
280
280
|
* @returns 0-同一单位时间 1-新单位时间 -1时间戳大于当前时间
|
|
281
281
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsSameTimeCheck-时间比对
|
|
282
282
|
*/
|
|
283
|
-
libJsSameTimeCheck: (timestamp: number, unit: import("dayjs").OpUnitType) =>
|
|
283
|
+
libJsSameTimeCheck: (timestamp: number, unit: import("dayjs").OpUnitType) => 1 | -1 | 0;
|
|
284
284
|
/** @description 时间差计算
|
|
285
285
|
* @param timestamp 毫秒时间戳
|
|
286
286
|
* @link 使用方法:https://www.npmjs.com/package/lyb-js#LibJsTimeAgo-中文时间差
|