MCPcopy
hub / github.com/mobxjs/mobx / getPlainObjectKeys

Function getPlainObjectKeys

packages/mobx/src/utils/utils.ts:172–183  ·  view source on GitHub ↗
(object: any)

Source from the content-addressed store, hash-verified

170 * Returns the following: own enumerable keys and symbols.
171 */
172export function getPlainObjectKeys(object: any) {
173 const keys = Object.keys(object)
174 // Not supported in IE, so there are not going to be symbol props anyway...
175 if (!hasGetOwnPropertySymbols) {
176 return keys
177 }
178 const symbols = Object.getOwnPropertySymbols(object)
179 if (!symbols.length) {
180 return keys
181 }
182 return [...keys, ...symbols.filter(s => objectPrototype.propertyIsEnumerable.call(object, s))]
183}
184
185// From Immer utils
186// Returns all own keys, including non-enumerable and symbolic

Callers 1

mergeMethod · 0.85

Calls 1

keysMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…