删除无用的方法

This commit is contained in:
dftre 2025-06-14 17:33:33 +08:00
parent 016abff41d
commit 46760ad626

View File

@ -1,64 +1,5 @@
import { tansParams } from "./ruoyi";
/**
*
* @param {*} str
* @param {*} pattern *?
* @returns
*/
export function wildcardCompare(str: string, pattern: string): boolean {
const regex = pattern.replace(/[*?]/g, (match) => {
if (match === "*") {
return ".*";
} else if (match === "?") {
return ".";
} else {
return match;
}
});
const regexPattern = new RegExp("^" + regex + "$");
return regexPattern.test(str);
}
/**
*
* @param obj
* @returns
*/
export function deepClone(obj: any) {
if (obj == null || typeof obj !== "object") {
return obj;
}
let result;
if (Array.isArray(obj)) {
result = [];
} else {
result = new Map();
}
for (let [key, value] of Object.entries(obj)) {
// @ts-ignore
result[key] = deepClone(value);
}
return result;
}
/**
*
* @param obj
* @param result
* @returns
*/
export function deepCloneTo<T>(obj: T, result: T) {
if (obj == null || typeof obj !== "object") {
return obj;
}
for (let [key, value] of Object.entries(obj)) {
// @ts-ignore
result[key] = deepClone(value);
}
return result;
}
/**
* uuid
* @returns uuid字符串