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

vuex

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vuex - npm Package Compare versions

Comparing version 2.3.0 to 2.3.1

1

dist/logger.d.ts

@@ -10,2 +10,3 @@ /**

collapsed?: boolean;
filter?: <P extends Payload>(mutation: P, stateBefore: S, stateAfter: S) => boolean;
transformer?: (state: S) => any;

@@ -12,0 +13,0 @@ mutationTransformer?: <P extends Payload>(mutation: P) => any;

2

package.json
{
"name": "vuex",
"version": "2.3.0",
"version": "2.3.1",
"description": "state management for Vue.js",

@@ -5,0 +5,0 @@ "main": "dist/vuex.js",

@@ -7,2 +7,3 @@ // Credits: borrowed code from fcomb/redux-logger

collapsed = true,
filter = (mutation, stateBefore, stateAfter) => true,
transformer = state => state,

@@ -19,25 +20,28 @@ mutationTransformer = mut => mut

const nextState = deepCopy(state)
const time = new Date()
const formattedTime = ` @ ${pad(time.getHours(), 2)}:${pad(time.getMinutes(), 2)}:${pad(time.getSeconds(), 2)}.${pad(time.getMilliseconds(), 3)}`
const formattedMutation = mutationTransformer(mutation)
const message = `mutation ${mutation.type}${formattedTime}`
const startMessage = collapsed
? console.groupCollapsed
: console.group
// render
try {
startMessage.call(console, message)
} catch (e) {
console.log(message)
}
if (filter(mutation, prevState, nextState)) {
const time = new Date()
const formattedTime = ` @ ${pad(time.getHours(), 2)}:${pad(time.getMinutes(), 2)}:${pad(time.getSeconds(), 2)}.${pad(time.getMilliseconds(), 3)}`
const formattedMutation = mutationTransformer(mutation)
const message = `mutation ${mutation.type}${formattedTime}`
const startMessage = collapsed
? console.groupCollapsed
: console.group
console.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState))
console.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation)
console.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState))
// render
try {
startMessage.call(console, message)
} catch (e) {
console.log(message)
}
try {
console.groupEnd()
} catch (e) {
console.log('—— log end ——')
console.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState))
console.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation)
console.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState))
try {
console.groupEnd()
} catch (e) {
console.log('—— log end ——')
}
}

@@ -44,0 +48,0 @@

@@ -14,3 +14,2 @@ import applyMixin from './mixin'

const {
state = {},
plugins = [],

@@ -20,2 +19,9 @@ strict = false

let {
state = {}
} = options
if (typeof state === 'function') {
state = state()
}
// store internal state

@@ -22,0 +28,0 @@ this._committing = false

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