mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 19:24:16 +00:00
[Improvement] optimize utils (#661)
This commit is contained in:
@@ -7,6 +7,11 @@ function isDef(value) {
|
||||
return value !== undefined && value !== null;
|
||||
}
|
||||
|
||||
function isObj(x) {
|
||||
const type = typeof x;
|
||||
return x !== null && (type === 'object' || type === 'function');
|
||||
}
|
||||
|
||||
function get(object, path) {
|
||||
const keys = path.split('.');
|
||||
let result = object;
|
||||
@@ -30,6 +35,7 @@ function isAndroid() {
|
||||
|
||||
export {
|
||||
get,
|
||||
isObj,
|
||||
isDef,
|
||||
create,
|
||||
isServer,
|
||||
|
Reference in New Issue
Block a user