@uppy/store-default
Advanced tools
Comparing version 3.0.3 to 3.0.4
function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; } | ||
var id = 0; | ||
function _classPrivateFieldLooseKey(name) { return "__private_" + id++ + "_" + name; } | ||
const packageJson = { | ||
"version": "3.0.3" | ||
"version": "3.0.4" | ||
}; | ||
@@ -13,7 +10,4 @@ /** | ||
*/ | ||
var _callbacks = /*#__PURE__*/_classPrivateFieldLooseKey("callbacks"); | ||
var _publish = /*#__PURE__*/_classPrivateFieldLooseKey("publish"); | ||
class DefaultStore { | ||
@@ -30,21 +24,18 @@ constructor() { | ||
} | ||
getState() { | ||
return this.state; | ||
} | ||
setState(patch) { | ||
const prevState = { ...this.state | ||
const prevState = { | ||
...this.state | ||
}; | ||
const nextState = { ...this.state, | ||
const nextState = { | ||
...this.state, | ||
...patch | ||
}; | ||
this.state = nextState; | ||
_classPrivateFieldLooseBase(this, _publish)[_publish](prevState, nextState, patch); | ||
} | ||
subscribe(listener) { | ||
_classPrivateFieldLooseBase(this, _callbacks)[_callbacks].add(listener); | ||
return () => { | ||
@@ -54,5 +45,3 @@ _classPrivateFieldLooseBase(this, _callbacks)[_callbacks].delete(listener); | ||
} | ||
} | ||
function _publish2() { | ||
@@ -62,3 +51,2 @@ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
} | ||
_classPrivateFieldLooseBase(this, _callbacks)[_callbacks].forEach(listener => { | ||
@@ -68,4 +56,3 @@ listener(...args); | ||
} | ||
DefaultStore.VERSION = packageJson.version; | ||
export default DefaultStore; |
{ | ||
"name": "@uppy/store-default", | ||
"description": "The default simple object-based store for Uppy.", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"license": "MIT", | ||
@@ -19,3 +19,3 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@jest/globals": "^29.0.0" | ||
"vitest": "^0.34.5" | ||
}, | ||
@@ -22,0 +22,0 @@ "repository": { |
@@ -1,2 +0,2 @@ | ||
import { describe, expect, it } from '@jest/globals' | ||
import { describe, expect, it } from 'vitest' | ||
import assert from 'node:assert' | ||
@@ -3,0 +3,0 @@ import DefaultStore from './index.js' |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11307
134