fei.wang
9 天以前 ae7b22322555448d95fd56f505bafa325c167a26
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict';
 
var GetIntrinsic = require('get-intrinsic');
 
var safePushApply = require('safe-push-apply');
 
var $ownKeys = GetIntrinsic('%Reflect.ownKeys%', true);
var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%', true);
var $gOPS = GetIntrinsic('%Object.getOwnPropertySymbols%', true);
 
var keys = require('object-keys');
 
/** @type {import('.')} */
module.exports = $ownKeys || function ownKeys(source) {
    /** @type {(keyof typeof source)[]} */
    var sourceKeys = ($gOPN || keys)(source);
    if ($gOPS) {
        safePushApply(sourceKeys, $gOPS(source));
    }
    return sourceKeys;
};