@exodus/atoms 6.0.2 → 7.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [7.0.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@7.0.0...@exodus/atoms@7.0.1) (2024-01-09)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **atoms:** add missing dependency ([#5307](https://github.com/ExodusMovement/exodus-hydra/issues/5307)) ([5370c83](https://github.com/ExodusMovement/exodus-hydra/commit/5370c83fcd33f77801928a6ecd5b4ca74b26b4aa))
11
+
12
+ ## [7.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@6.0.2...@exodus/atoms@7.0.0) (2023-12-10)
13
+
14
+ ### ⚠ BREAKING CHANGES
15
+
16
+ - don't call serialize/deserialize on `undefined` in withSerialization (#4896)
17
+
18
+ ### Features
19
+
20
+ - don't call serialize/deserialize on `undefined` in withSerialization ([#4896](https://github.com/ExodusMovement/exodus-hydra/issues/4896)) ([20a7a32](https://github.com/ExodusMovement/exodus-hydra/commit/20a7a321e00a527c94650222e45c0a970164c92c))
21
+
6
22
  ## [6.0.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@6.0.1...@exodus/atoms@6.0.2) (2023-11-30)
7
23
 
8
24
  ### Bug Fixes
@@ -4,5 +4,5 @@ type Params<T, S> = {
4
4
  serialize: (value: T) => S;
5
5
  deserialize: (serialized: S) => T;
6
6
  };
7
- declare const withSerialization: <T, S>({ atom, serialize, deserialize }: Params<T, S>) => Atom<T>;
7
+ declare const withSerialization: <T, S>({ atom, serialize: customSerialize, deserialize: customDeserialize, }: Params<T, S>) => Atom<T>;
8
8
  export default withSerialization;
@@ -1,5 +1,7 @@
1
1
  import { isSetter } from '../utils/guards';
2
- const withSerialization = ({ atom, serialize, deserialize }) => {
2
+ const withSerialization = ({ atom, serialize: customSerialize, deserialize: customDeserialize, }) => {
3
+ const serialize = (value) => (value === undefined ? undefined : customSerialize(value));
4
+ const deserialize = (value) => (value === undefined ? undefined : customDeserialize(value));
3
5
  const get = async () => {
4
6
  const serialized = await atom.get();
5
7
  return deserialize(serialized);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/atoms",
3
- "version": "6.0.2",
3
+ "version": "7.0.1",
4
4
  "main": "lib/index.js",
5
5
  "description": "Abstraction for encapsulating a piece of data behind a simple unified interface: get, set, observe",
6
6
  "author": "Exodus Movement Inc.",
@@ -9,7 +9,8 @@
9
9
  "clean": "yarn run -T tsc --build --clean",
10
10
  "test": "jest",
11
11
  "lint": "eslint . --ignore-path ../../.gitignore",
12
- "lint:fix": "yarn lint --fix"
12
+ "lint:fix": "yarn lint --fix",
13
+ "prepublishOnly": "yarn run -T build --scope @exodus/atoms"
13
14
  },
14
15
  "files": [
15
16
  "lib",
@@ -26,6 +27,7 @@
26
27
  },
27
28
  "dependencies": {
28
29
  "@exodus/storage-interface": "^1.0.0",
30
+ "delay": "^5.0.0",
29
31
  "events": "^3.3.0",
30
32
  "lodash": "^4.17.21",
31
33
  "make-concurrent": ">=4 <6",
@@ -37,11 +39,11 @@
37
39
  "@exodus/atom-tests": "^1.0.0",
38
40
  "@exodus/remote-config": "^2.3.0",
39
41
  "@exodus/storage-memory": "^2.1.1",
42
+ "@types/jest": "^29.5.11",
40
43
  "@types/lodash": "^4.14.200",
41
44
  "@types/minimalistic-assert": "^1.0.2",
42
- "delay": "^5.0.0",
43
45
  "eslint": "^8.44.0",
44
46
  "jest": "^29.1.2"
45
47
  },
46
- "gitHead": "de43a336a0ff423f1e1c0cbc549f72c4619f04a4"
48
+ "gitHead": "26ed6dd1606a05315f3853cb0f8430dd3a6fc789"
47
49
  }