]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
refactor: better isPlainObject
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 28 Jul 2021 13:16:43 +0000 (15:16 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 28 Jul 2021 13:16:43 +0000 (15:16 +0200)
src/types.ts

index b1a12727b84a7141089994a180b014a26ba314b8..e00bb23f4ccca013c8e19cab1ae50c2a619d88f0 100644 (file)
@@ -6,6 +6,9 @@ import { Pinia } from './rootStore'
  */
 export type StateTree = Record<string | number | symbol, any>
 
+export function isPlainObject<S extends StateTree>(
+  value: S | unknown
+): value is S
 export function isPlainObject(
   // eslint-disable-next-line @typescript-eslint/no-explicit-any
   o: any