27 lines
649 B
TypeScript
Raw Permalink Normal View History

2024-11-05 10:14:41 +08:00
/* eslint-disable indent */
import { baseIsArguments } from './_baseIsArguments'
import { isObjectLike } from './is-object-like'
const objectProto = Object.prototype
const hasOwnProperty = objectProto.hasOwnProperty
const propertyIsEnumerable = objectProto.propertyIsEnumerable
const isArguments = baseIsArguments(
(function () {
// eslint-disable-next-line prefer-rest-params
return arguments
})()
)
? baseIsArguments
: function (value: any) {
return (
isObjectLike(value) &&
hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee')
)
}
export { isArguments }