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.
21 lines
583 B
21 lines
583 B
'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; |
|
};
|
|
|