mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
build(projects): 依赖升级,规范目录
This commit is contained in:
13
src/utils/common/index.ts
Normal file
13
src/utils/common/index.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export {
|
||||
isNumber,
|
||||
isString,
|
||||
isBoolean,
|
||||
isNull,
|
||||
isUndefined,
|
||||
isObject,
|
||||
isArray,
|
||||
isDate,
|
||||
isRegExp,
|
||||
isSet,
|
||||
isMap
|
||||
} from './typeof';
|
47
src/utils/common/typeof.ts
Normal file
47
src/utils/common/typeof.ts
Normal file
@ -0,0 +1,47 @@
|
||||
enum DataType {
|
||||
number = '[object Number]',
|
||||
string = '[object String]',
|
||||
boolean = '[object Object]',
|
||||
null = '[object Null]',
|
||||
undefined = '[object Undefined]',
|
||||
object = '[object Object]',
|
||||
array = '[object Array]',
|
||||
date = '[object Date]',
|
||||
regexp = '[object RegExp]',
|
||||
set = '[object Set]',
|
||||
map = '[object Map]'
|
||||
}
|
||||
|
||||
export function isNumber(data: any) {
|
||||
return Object.prototype.toString.call(data) === DataType.number;
|
||||
}
|
||||
export function isString(data: any) {
|
||||
return Object.prototype.toString.call(data) === DataType.string;
|
||||
}
|
||||
export function isBoolean(data: any) {
|
||||
return Object.prototype.toString.call(data) === DataType.boolean;
|
||||
}
|
||||
export function isNull(data: any) {
|
||||
return Object.prototype.toString.call(data) === DataType.null;
|
||||
}
|
||||
export function isUndefined(data: any) {
|
||||
return Object.prototype.toString.call(data) === DataType.undefined;
|
||||
}
|
||||
export function isObject(data: any) {
|
||||
return Object.prototype.toString.call(data) === DataType.object;
|
||||
}
|
||||
export function isArray(data: any) {
|
||||
return Object.prototype.toString.call(data) === DataType.array;
|
||||
}
|
||||
export function isDate(data: any) {
|
||||
return Object.prototype.toString.call(data) === DataType.date;
|
||||
}
|
||||
export function isRegExp(data: any) {
|
||||
return Object.prototype.toString.call(data) === DataType.regexp;
|
||||
}
|
||||
export function isSet(data: any) {
|
||||
return Object.prototype.toString.call(data) === DataType.set;
|
||||
}
|
||||
export function isMap(data: any) {
|
||||
return Object.prototype.toString.call(data) === DataType.map;
|
||||
}
|
@ -1 +1,14 @@
|
||||
export { getStorageToken, getStorageUserInfo } from './auth';
|
||||
export {
|
||||
isNumber,
|
||||
isString,
|
||||
isBoolean,
|
||||
isNull,
|
||||
isUndefined,
|
||||
isObject,
|
||||
isArray,
|
||||
isDate,
|
||||
isRegExp,
|
||||
isSet,
|
||||
isMap
|
||||
} from './common';
|
||||
|
0
src/utils/storage/local.ts
Normal file
0
src/utils/storage/local.ts
Normal file
0
src/utils/storage/session.ts
Normal file
0
src/utils/storage/session.ts
Normal file
Reference in New Issue
Block a user