@exodus/atoms 7.5.0 → 7.6.0

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,20 @@
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.6.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@7.5.1...@exodus/atoms@7.6.0) (2024-07-05)
7
+
8
+ ### Features
9
+
10
+ - use safe stringify ([#7653](https://github.com/ExodusMovement/exodus-hydra/issues/7653)) ([a3d922d](https://github.com/ExodusMovement/exodus-hydra/commit/a3d922d48911d963361b896f6bcefa1dc9e255aa))
11
+
12
+ ### Bug Fixes
13
+
14
+ - use default import from lodash ([#7611](https://github.com/ExodusMovement/exodus-hydra/issues/7611)) ([2e83743](https://github.com/ExodusMovement/exodus-hydra/commit/2e8374308f290e24f22e8e41b99be7b7a83d6365))
15
+
16
+ ## [7.5.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@7.5.0...@exodus/atoms@7.5.1) (2024-07-02)
17
+
18
+ **Note:** Version bump only for package @exodus/atoms
19
+
6
20
  ## [7.5.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@7.4.1...@exodus/atoms@7.5.0) (2024-06-20)
7
21
 
8
22
  ### Features
@@ -1,5 +1,6 @@
1
- import { isEqual } from 'lodash';
1
+ import lodash from 'lodash';
2
2
  import { isSetter } from '../utils/guards.js';
3
+ const { isEqual } = lodash;
3
4
  const dedupe = (atom) => {
4
5
  const set = (value) => {
5
6
  if (value === undefined)
@@ -1,9 +1,11 @@
1
1
  import assert from 'minimalistic-assert';
2
- import { isEqual as deepEqual } from 'lodash';
2
+ import lodash from 'lodash';
3
+ import stringify from 'json-stringify-safe';
4
+ const { isEqual: deepEqual } = lodash;
3
5
  const STRINGIFY_LIMIT = 1000;
4
6
  const limitedStringify = (obj, limit = STRINGIFY_LIMIT) => {
5
7
  let count = 0;
6
- return JSON.stringify(obj, (_, value) => {
8
+ return stringify(obj, (_, value) => {
7
9
  if (count > limit) {
8
10
  return;
9
11
  }
@@ -1,11 +1,10 @@
1
- import EventEmitter from 'events/';
1
+ import EventEmitter from 'eventemitter3';
2
2
  import fromEventEmitter from '../event-emitter.js';
3
3
  import pDefer from 'p-defer';
4
4
  const createAtomMock = (options = {}) => {
5
5
  const { defaultValue } = options;
6
6
  let latestValue = defaultValue;
7
7
  const emitter = new EventEmitter();
8
- emitter.setMaxListeners(Number.POSITIVE_INFINITY);
9
8
  const initialized = pDefer();
10
9
  const get = async () => {
11
10
  if (!('defaultValue' in options)) {
@@ -1,6 +1,7 @@
1
- import { get as getValueAtPath, isEqual } from 'lodash';
1
+ import lodash from 'lodash';
2
2
  import createSimpleObserver from '../simple-observer.js';
3
3
  import enforceObservableRules from '../enforce-rules.js';
4
+ const { get: getValueAtPath, isEqual } = lodash;
4
5
  const createRemoteConfigAtomFactory = ({ remoteConfig }) => ({ defaultValue, ...params }) => {
5
6
  if ('path' in params && 'selector' in params) {
6
7
  throw new Error('Provide either a path or a selector to get data from remote config - not both.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/atoms",
3
- "version": "7.5.0",
3
+ "version": "7.6.0",
4
4
  "description": "Abstraction for encapsulating a piece of data behind a simple unified interface: get, set, observe",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -31,7 +31,8 @@
31
31
  "@exodus/basic-utils": "^2.5.2",
32
32
  "@exodus/storage-interface": "^1.0.0",
33
33
  "delay": "^5.0.0",
34
- "events": "^3.3.0",
34
+ "eventemitter3": "^4.0.7",
35
+ "json-stringify-safe": "^5.0.1",
35
36
  "lodash": "^4.17.21",
36
37
  "make-concurrent": ">=4 <6",
37
38
  "minimalistic-assert": "^1.0.1",
@@ -43,8 +44,10 @@
43
44
  "@exodus/remote-config": "^2.4.0",
44
45
  "@exodus/storage-memory": "^2.1.1",
45
46
  "@types/jest": "^29.5.11",
47
+ "@types/json-stringify-safe": "^5.0.3",
46
48
  "@types/lodash": "^4.14.200",
47
- "@types/minimalistic-assert": "^1.0.2"
49
+ "@types/minimalistic-assert": "^1.0.2",
50
+ "events": "^3.3.0"
48
51
  },
49
- "gitHead": "fcd5965484abd4f333448c9eaaf1f7fa6c4cb3f1"
52
+ "gitHead": "d0e63bad197e0af768cf8f8fafde350e97b2c9d8"
50
53
  }