cxc-szcx-uniapp/uni_modules/lime-shared/isDef/index.ts

23 lines
570 B
TypeScript
Raw Normal View History

2024-09-14 02:26:50 +00:00
// @ts-nocheck
/**
* undefined null
* @param value
* @returns null true false
*/
// #ifndef UNI-APP-X
export function isDef(value: unknown): boolean {
return value !== undefined && value !== null;
}
// #endif
// #ifdef UNI-APP-X
export function isDef(value : any|null) : boolean {
2025-02-11 01:34:29 +00:00
// #ifdef UNI-APP-X && APP
2024-09-14 02:26:50 +00:00
return value != null;
// #endif
2025-02-11 01:34:29 +00:00
// #ifndef UNI-APP-X && APP
2024-09-14 02:26:50 +00:00
return value != null && value != undefined;
// #endif
}
// #endif