const MUTATIONS_LAYER_ID = 'pinia:mutations'
const INSPECTOR_ID = 'pinia'
+const { assign } = Object
/**
* Gets the displayed name of a store in devtools
const eventData: TimelineEvent = {
time: now(),
title: formatMutationType(type),
- data: {
- store: formatDisplay(store.$id),
- ...formatEventData(events),
- },
+ data: assign(
+ { store: formatDisplay(store.$id) },
+ formatEventData(events)
+ ),
groupId: activeAction,
}
// avoid listing internal properties in devtools
;(['_p', '_hmrPayload', '_getters', '_customProperties'] as const).forEach(
(p) => {
- Object.defineProperty(store, p, {
- value: store[p],
- ...nonEnumerable,
- })
+ Object.defineProperty(
+ store,
+ p,
+ assign({ value: store[p] }, nonEnumerable)
+ )
}
)
}