feat: 初始化

This commit is contained in:
George
2025-07-07 15:55:44 +08:00
commit 9b7bfcfe5a
969 changed files with 123036 additions and 0 deletions

View File

@ -0,0 +1,9 @@
// @ts-nocheck
// #ifdef APP-IOS || APP-ANDROID
export * from './uvue.ts'
// #endif
// #ifndef APP-IOS || APP-ANDROID
export * from './vue.ts'
// #endif

View File

@ -0,0 +1,39 @@
// @ts-nocheck
/**
* 检查对象或数组是否具有指定的属性或键
* @param obj 要检查的对象或数组
* @param key 指定的属性或键
* @returns 如果对象或数组具有指定的属性或键则返回true否则返回false
*/
function hasOwn(obj: UTSJSONObject, key: string): boolean
function hasOwn(obj: Map<string, unknown>, key: string): boolean
function hasOwn(obj: any, key: string): boolean {
if(obj instanceof UTSJSONObject){
return obj[key] != null
}
if(obj instanceof Map<string, unknown>){
return (obj as Map<string, unknown>).has(key)
}
return false
}
export {
hasOwn
}
// 示例
// const obj = { name: 'John', age: 30 };
// if (hasOwn(obj, 'name')) {
// console.log("对象具有 'name' 属性");
// } else {
// console.log("对象不具有 'name' 属性");
// }
// // 输出: 对象具有 'name' 属性
// const arr = [1, 2, 3];
// if (hasOwn(arr, 'length')) {
// console.log("数组具有 'length' 属性");
// } else {
// console.log("数组不具有 'length' 属性");
// }
// 输出: 数组具有 'length' 属性

View File

@ -0,0 +1,30 @@
// @ts-nocheck
const hasOwnProperty = Object.prototype.hasOwnProperty
/**
* 检查对象或数组是否具有指定的属性或键
* @param obj 要检查的对象或数组
* @param key 指定的属性或键
* @returns 如果对象或数组具有指定的属性或键则返回true否则返回false
*/
export function hasOwn(obj: Object | Array<any>, key: string): boolean {
return hasOwnProperty.call(obj, key);
}
// 示例
// const obj = { name: 'John', age: 30 };
// if (hasOwn(obj, 'name')) {
// console.log("对象具有 'name' 属性");
// } else {
// console.log("对象不具有 'name' 属性");
// }
// // 输出: 对象具有 'name' 属性
// const arr = [1, 2, 3];
// if (hasOwn(arr, 'length')) {
// console.log("数组具有 'length' 属性");
// } else {
// console.log("数组不具有 'length' 属性");
// }
// 输出: 数组具有 'length' 属性