MCPcopy Create free account
hub / github.com/denoland/std / getEnumerableKeys

Function getEnumerableKeys

async/all_keyed.ts:7–13  ·  view source on GitHub ↗
(obj: object)

Source from the content-addressed store, hash-verified

5// This equivalent is faster on V8: Object.keys returns only enumerable string keys,
6// so we only need to filter symbol keys for enumerability. See also assert/equal.ts.
7function getEnumerableKeys(obj: object): PropertyKey[] {
8 const stringKeys = Object.keys(obj);
9 const symbolKeys = Object.getOwnPropertySymbols(obj).filter((key) =>
10 Object.prototype.propertyIsEnumerable.call(obj, key)
11 );
12 return [...stringKeys, ...symbolKeys];
13}
14
15/**
16 * A record type where values can be promise-like (thenables) or plain values.

Callers 2

allKeyedFunction · 0.85
allSettledKeyedFunction · 0.85

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected