react-native-onyx 2.0.119 → 2.0.121

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/dist/Onyx.js CHANGED
@@ -158,7 +158,7 @@ function set(key, value, options) {
158
158
  OnyxUtils_1.default.logKeyRemoved(OnyxUtils_1.default.METHOD.SET, key);
159
159
  return Promise.resolve();
160
160
  }
161
- const valueWithoutNestedNullValues = ((options === null || options === void 0 ? void 0 : options.skipNullRemoval) ? value : utils_1.default.removeNestedNullValues(value));
161
+ const valueWithoutNestedNullValues = ((options === null || options === void 0 ? void 0 : options.skipNullRemoval) ? Object.assign({}, value) : utils_1.default.removeNestedNullValues(value));
162
162
  const hasChanged = (options === null || options === void 0 ? void 0 : options.skipCacheCheck) ? true : OnyxCache_1.default.hasValueChanged(key, valueWithoutNestedNullValues);
163
163
  OnyxUtils_1.default.logKeyChanged(OnyxUtils_1.default.METHOD.SET, key, value, hasChanged);
164
164
  // This approach prioritizes fast UI changes without waiting for data to be stored in device storage.
package/dist/utils.js CHANGED
@@ -108,11 +108,11 @@ function isMergeableObject(value) {
108
108
  }
109
109
  /** Deep removes the nested null values from the given value. */
110
110
  function removeNestedNullValues(value) {
111
- if (value === null || value === undefined) {
111
+ if (value === null || value === undefined || typeof value !== 'object') {
112
112
  return value;
113
113
  }
114
- if (typeof value !== 'object' || Array.isArray(value)) {
115
- return value;
114
+ if (Array.isArray(value)) {
115
+ return [...value];
116
116
  }
117
117
  const result = {};
118
118
  // eslint-disable-next-line no-restricted-syntax, guard-for-in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-onyx",
3
- "version": "2.0.119",
3
+ "version": "2.0.121",
4
4
  "author": "Expensify, Inc.",
5
5
  "homepage": "https://expensify.com",
6
6
  "description": "State management for React Native",