New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@logux/vuex

Package Overview
Dependencies
Maintainers
2
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@logux/vuex - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0-beta.1

utils/getNestedObject.js

3

CHANGELOG.md
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).
## 0.5.0-beta.1
* Fix incorrect behavior with modules ([#26](https://github.com/logux/vuex/issues/26))
## 0.4.0

@@ -5,0 +8,0 @@ * Add `loguxComponent`, component with scoped slots ([#18](https://github.com/logux/vuex/pull/18), [#25](https://github.com/logux/vuex/pull/25)) (by Stanislav Lashmanov)

@@ -6,3 +6,3 @@ let { createNanoEvents } = require('nanoevents')

let { deepCopy } = require('../utils/deepCopy')
let { deepCopy, getNestedObject } = require('../utils')

@@ -130,9 +130,26 @@ function createLogux (config = { }) {

function replaceState (state, actions, pushHistory) {
let last = actions.length ? actions[actions.length - 1][1] : ''
let newState = actions.reduceRight((prev, [action, id]) => {
let changed = deepCopy(prev)
let last = actions[actions.length - 1][1]
if (vuexConfig.mutations[action.type]) {
vuexConfig.mutations[action.type](changed, action)
if (action.type in store._mutations) {
let moduleName = action.type.split('/')[0]
let module = getNestedObject(vuexConfig, ['modules', moduleName])
let actionTypeNamespaced = action.type.split(`${ moduleName }/`)[1]
if (
module &&
module.namespaced &&
getNestedObject(module, ['mutations', actionTypeNamespaced])
) {
module.mutations[actionTypeNamespaced](changed[moduleName], action)
} else if (
module &&
getNestedObject(module, ['mutations', action.type])
) {
module.mutations[action.type](changed[moduleName], action)
} else {
vuexConfig.mutations[action.type](changed, action)
}
}
if (pushHistory && id === last) {

@@ -203,3 +220,14 @@ stateHistory[pushHistory] = changed

if (!replayed) {
replaceState(deepCopy(vuexConfig.state), actions)
let storeConfig = deepCopy(vuexConfig)
let state = storeConfig.state || {}
if (storeConfig.modules) {
Object.entries(storeConfig.modules).forEach(
([moduleName, module]) => {
state = { ...state, [moduleName]: module.state }
}
)
}
replaceState(state, actions)
}

@@ -206,0 +234,0 @@ }

2

package.json
{
"name": "@logux/vuex",
"version": "0.4.0",
"version": "0.5.0-beta.1",
"description": "Vuex compatible API for Logux",

@@ -5,0 +5,0 @@ "keywords": [

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