Subscribe Rules

This commit is contained in:
Gabe Yuan
2023-08-20 19:27:29 +08:00
parent a8caa34bbe
commit 7ec43a1d3f
12 changed files with 491 additions and 105 deletions

View File

@@ -88,3 +88,13 @@ export const isMatch = (s, p) => {
return p.slice(pIndex).replaceAll("*", "") === "";
};
/**
* 类型检查
* @param {*} o
* @returns
*/
export const type = (o) => {
const s = Object.prototype.toString.call(o);
return s.match(/\[object (.*?)\]/)[1].toLowerCase();
};