uview-plus组件库全面升级更新,订单结算判断支付方式是否可用代码调整,公众号关注二维码修改

This commit is contained in:
2025-10-21 10:44:31 +08:00
parent 5d98b7efc2
commit 5f3a307fec
395 changed files with 31264 additions and 2477 deletions

View File

@@ -0,0 +1,40 @@
// @ts-nocheck
import { isNumber } from '../isNumber'
import { isString } from '../isString'
// 函数重载,定义多个函数签名
// function toBoolean(value : any) : boolean;
// function toBoolean(value : string) : boolean;
// function toBoolean(value : number) : boolean;
// function toBoolean(value : boolean) : boolean;
// #ifdef UNI-APP-X && APP
function toBoolean(value : any | null) : boolean {
// 根据输入值的类型,返回相应的布尔值
// if (isNumber(value)) {
// return (value as number) != 0;
// }
// if (isString(value)) {
// return `${value}`.length > 0;
// }
// if (typeof value == 'boolean') {
// return value as boolean;
// }
// #ifdef APP-IOS || APP-HARMONY
return value != null && value != undefined
// #endif
// #ifdef APP-ANDROID
return value != null
// #endif
}
// #endif
// #ifndef UNI-APP-X && APP
function toBoolean(value : any | null) : value is NonNullable<typeof value> {
return !!value//value !== null && value !== undefined;
}
// #endif
export {
toBoolean
}