This commit is contained in:
zk
2023-12-11 18:34:15 +08:00
parent e449d5687b
commit 35f21a4342
11 changed files with 380 additions and 52 deletions
+12
View File
@@ -0,0 +1,12 @@
const objectToString = Object.prototype.toString;
const toTypeString = (value: any) => objectToString.call(value);
export const { isArray } = Array;
export const isMap = (val: any) => toTypeString(val) === '[object Map]';
export const isSet = (val: any) => toTypeString(val) === '[object Set]';
export const isDate = (val: any) => val instanceof Date;
export const isFunction = (val: any) => typeof val === 'function';
export const isString = (val: any) => typeof val === 'string';
export const isSymbol = (val: any) => typeof val === 'symbol';
export const isObject = (val: null) => val !== null && typeof val === 'object';
export const isPromise = (val: any) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
+4
View File
@@ -22,4 +22,8 @@ export function useTopTime() {
timeLeft,
timeRight,
};
}
export function getToday() {
return dayjs().format('YYYY-MM-DD');
}