init
This commit is contained in:
14
fuintUniapp/components/common/utils.js
Normal file
14
fuintUniapp/components/common/utils.js
Normal file
@@ -0,0 +1,14 @@
|
||||
function isDef(value) {
|
||||
return value !== undefined && value !== null;
|
||||
}
|
||||
function isObj(x) {
|
||||
const type = typeof x;
|
||||
return x !== null && (type === 'object' || type === 'function');
|
||||
}
|
||||
function isNumber(value) {
|
||||
return /^\d+$/.test(value);
|
||||
}
|
||||
function range(num, min, max) {
|
||||
return Math.min(Math.max(num, min), max);
|
||||
}
|
||||
export { isObj, isDef, isNumber, range };
|
||||
Reference in New Issue
Block a user