合同小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
570 B

  1. // @ts-nocheck
  2. /**
  3. * undefined null
  4. * @param value
  5. * @returns null true false
  6. */
  7. // #ifndef UNI-APP-X
  8. export function isDef(value: unknown): boolean {
  9. return value !== undefined && value !== null;
  10. }
  11. // #endif
  12. // #ifdef UNI-APP-X
  13. export function isDef(value : any|null) : boolean {
  14. // #ifdef UNI-APP-X && APP
  15. return value != null;
  16. // #endif
  17. // #ifndef UNI-APP-X && APP
  18. return value != null && value != undefined;
  19. // #endif
  20. }
  21. // #endif