@umituz/react-native-storage 1.2.1 → 1.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-storage",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Domain-Driven Design storage system for React Native apps with type-safe AsyncStorage operations",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -41,7 +41,7 @@ export const unwrap = <T>(result: StorageResult<T>, defaultValue: T): T => {
41
41
  if (result.success) {
42
42
  return result.data;
43
43
  }
44
- return result.fallback ?? defaultValue;
44
+ return result.fallback !== undefined ? result.fallback : defaultValue;
45
45
  };
46
46
 
47
47
  /**
@@ -54,5 +54,5 @@ export const map = <T, U>(
54
54
  if (result.success) {
55
55
  return success(fn(result.data));
56
56
  }
57
- return result as StorageResult<U>;
57
+ return failure(result.error, result.fallback !== undefined ? fn(result.fallback) : undefined);
58
58
  };