EASYAIuniappNewUI/node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_baseKeys.ts
2025-02-08 18:50:38 +08:00

19 lines
462 B
TypeScript

import { isPrototype } from './_isPrototype'
import { nativeKeys } from './_nativeKeys'
const objectProto = Object.prototype
const hasOwnProperty = objectProto.hasOwnProperty
export function baseKeys(object: any) {
if (!isPrototype(object)) {
return nativeKeys(object)
}
const result = []
for (const key in new Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key)
}
}
return result
}