Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 14x 14x 14x 14x 14x 14x 91x | import { ReflectApply } from './Reflect';
import type { Getter, Setter } from './types';
export const ObjectCtor = Object;
export const {
assign: ObjectAssign,
freeze: ObjectFreeze,
keys: ObjectKeys,
prototype: ObjectProto,
} = ObjectCtor;
const { hasOwn: OriginalObjectHasOwn } = ObjectCtor as any;
const {
__lookupGetter__: ObjectProtoLookupGetter,
__lookupSetter__: ObjectProtoLookupSetter,
hasOwnProperty: ObjectProtoHasOwnProperty,
} = ObjectProto as any;
export const ObjectHasOwn: (object: any, key: PropertyKey) => boolean =
typeof OriginalObjectHasOwn === 'function'
? OriginalObjectHasOwn
: /* istanbul ignore next: currently unreachable via tests */ function ObjectHasOwn(
object: any,
key: PropertyKey
): boolean {
return ReflectApply(ObjectProtoHasOwnProperty, object, [key]);
};
export const { toString: ObjectProtoToString } = ObjectProto;
export function isObject(value: any): boolean {
return typeof value === 'object' && value !== null;
}
export function ObjectLookupOwnGetter(object: any, key: PropertyKey): Getter | undefined {
return object === null || object === undefined || !ObjectHasOwn(object, key)
? undefined
: ReflectApply(ObjectProtoLookupGetter, object, [key]);
}
export function ObjectLookupOwnSetter(object: any, key: PropertyKey): Setter | undefined {
return object === null || object === undefined || !ObjectHasOwn(object, key)
? undefined
: ReflectApply(ObjectProtoLookupSetter, object, [key]);
}
|