662fa6362a
## Bug - [ ] Related issues linked using `fixes #33314` #33314 - [ ] Moved the `is-plain-object` file to the shared directory since it's emitted to the client and thus needs to be transpiled. This is just my 2nd PR so if I'm missing something please let me know.
12 lines
354 B
TypeScript
12 lines
354 B
TypeScript
export function getObjectClassLabel(value: any): string {
|
|
return Object.prototype.toString.call(value)
|
|
}
|
|
|
|
export function isPlainObject(value: any): boolean {
|
|
if (getObjectClassLabel(value) !== '[object Object]') {
|
|
return false
|
|
}
|
|
|
|
const prototype = Object.getPrototypeOf(value)
|
|
return prototype === null || prototype === Object.prototype
|
|
}
|