refactor(reactivity): reduce code of type check (#377)
This commit is contained in:
@@ -48,6 +48,10 @@ export const objectToString = Object.prototype.toString
|
||||
export const toTypeString = (value: unknown): string =>
|
||||
objectToString.call(value)
|
||||
|
||||
export function toRawType(value: unknown): string {
|
||||
return toTypeString(value).slice(8, -1)
|
||||
}
|
||||
|
||||
export const isPlainObject = (val: unknown): val is object =>
|
||||
toTypeString(val) === '[object Object]'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user