Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

direct-vuex

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

direct-vuex - npm Package Compare versions

Comparing version 0.11.1 to 0.12.0

CHANGELOG.txt

2

package.json
{
"name": "direct-vuex",
"version": "0.11.1",
"version": "0.12.0",
"description": "Use and implement your Vuex store with TypeScript types. Compatible with the Vue 3 composition API.",

@@ -5,0 +5,0 @@ "author": "Paleo",

@@ -38,6 +38,6 @@ import { ActionContext, Store } from "vuex"

type GetStateInModules<I extends ModulesImpl> = {
[M in keyof I]: DirectState<I[M]>
readonly [M in keyof I]: DirectState<I[M]>
}
type ToStateObj<T> = T extends (() => any) ? ReturnType<T> : T
type ToStateObj<T> = T extends (() => any) ? Readonly<ReturnType<T>> : Readonly<T>

@@ -54,9 +54,14 @@ // Getters

type GetGettersInModules<I extends ModulesImpl> = {
[M in keyof I]: DirectGetters<I[M]>
readonly [M in keyof I]: DirectGetters<I[M]>
}
type ToDirectGetters<T extends GettersImpl> = {
[K in keyof T]: ReturnType<T[K]>
readonly [K in keyof T]: ReadonlyReturnTypeExceptCb<T[K]>
}
type ReadonlyReturnTypeExceptCb<T extends (...args: any) => any> =
T extends ((...args1: any) => (...args2: any) => any)
? ReturnType<T>
: Readonly<ReturnType<T>>
type MergeGettersFromModules<I extends ModulesImpl> =

@@ -77,7 +82,7 @@ UnionToIntersection<ToDirectGetters<OrEmpty<I[keyof I]["getters"]>>>

type ToDirectMutations<T extends MutationsImpl> = {
[K in keyof T]: Parameters<T[K]>[1] extends undefined
? (() => void)
: (Extract<Parameters<T[K]>[1], undefined> extends never ?
((payload: Parameters<T[K]>[1]) => void) :
((payload?: Parameters<T[K]>[1]) => void))
[K in keyof T]: Parameters<T[K]>[1] extends undefined
? (() => void)
: (Extract<Parameters<T[K]>[1], undefined> extends never ?
((payload: Parameters<T[K]>[1]) => void) :
((payload?: Parameters<T[K]>[1]) => void))
}

@@ -100,7 +105,7 @@

type ToDirectActions<T extends ActionsImpl> = {
[K in keyof T]: Parameters<T[K]>[1] extends undefined
? (() => PromiseOf<ReturnType<T[K]>>)
: (Extract<Parameters<T[K]>[1], undefined> extends never ?
((payload: Parameters<T[K]>[1]) => PromiseOf<ReturnType<T[K]>>) :
((payload?: Parameters<T[K]>[1]) => PromiseOf<ReturnType<T[K]>>))
[K in keyof T]: Parameters<T[K]>[1] extends undefined
? (() => PromiseOf<ReturnType<T[K]>>)
: (Extract<Parameters<T[K]>[1], undefined> extends never ?
((payload: Parameters<T[K]>[1]) => PromiseOf<ReturnType<T[K]>>) :
((payload?: Parameters<T[K]>[1]) => PromiseOf<ReturnType<T[K]>>))
}

@@ -107,0 +112,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc