| 170 | * Returns the following: own enumerable keys and symbols. |
| 171 | */ |
| 172 | export 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 |