strata-storage 2.2.0 → 2.4.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/android/src/main/java/com/strata/storage/EncryptedStorage.java +110 -7
- package/android/src/main/java/com/strata/storage/SQLiteStorage.java +112 -2
- package/android/src/main/java/com/strata/storage/SharedPreferencesStorage.java +95 -7
- package/android/src/main/java/com/stratastorage/StrataStoragePlugin.java +10 -20
- package/dist/android/src/main/java/com/strata/storage/EncryptedStorage.java +110 -7
- package/dist/android/src/main/java/com/strata/storage/SQLiteStorage.java +112 -2
- package/dist/android/src/main/java/com/strata/storage/SharedPreferencesStorage.java +95 -7
- package/dist/android/src/main/java/com/stratastorage/StrataStoragePlugin.java +10 -20
- package/dist/ios/Plugin/KeychainStorage.swift +44 -9
- package/dist/ios/Plugin/SQLiteStorage.swift +36 -2
- package/dist/ios/Plugin/UserDefaultsStorage.swift +14 -0
- package/dist/package.json +1 -1
- package/ios/Plugin/KeychainStorage.swift +44 -9
- package/ios/Plugin/SQLiteStorage.swift +36 -2
- package/ios/Plugin/UserDefaultsStorage.swift +14 -0
- package/package.json +8 -8
|
@@ -59,4 +59,18 @@ import Foundation
|
|
|
59
59
|
@objc public func has(key: String) -> Bool {
|
|
60
60
|
return userDefaults.object(forKey: key) != nil
|
|
61
61
|
}
|
|
62
|
+
|
|
63
|
+
@objc public func size() -> (total: Int, count: Int) {
|
|
64
|
+
let all = userDefaults.dictionaryRepresentation()
|
|
65
|
+
var totalSize = 0
|
|
66
|
+
let count = all.count
|
|
67
|
+
|
|
68
|
+
for (key, value) in all {
|
|
69
|
+
// Estimate size (key + value in bytes)
|
|
70
|
+
totalSize += key.data(using: .utf8)?.count ?? 0
|
|
71
|
+
totalSize += "\(value)".data(using: .utf8)?.count ?? 0
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return (total: totalSize, count: count)
|
|
75
|
+
}
|
|
62
76
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strata-storage",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Zero-dependency universal storage plugin providing a unified API for all storage operations across web, Android, and iOS platforms",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -90,18 +90,18 @@
|
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@eslint/js": "^10.0.0",
|
|
93
|
-
"@types/node": "^24.
|
|
94
|
-
"@types/react": "^19.
|
|
95
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
96
|
-
"@typescript-eslint/parser": "^8.
|
|
93
|
+
"@types/node": "^24.7.0",
|
|
94
|
+
"@types/react": "^19.2.2",
|
|
95
|
+
"@typescript-eslint/eslint-plugin": "^8.46.0",
|
|
96
|
+
"@typescript-eslint/parser": "^8.46.0",
|
|
97
97
|
"@vitest/coverage-v8": "^3.2.4",
|
|
98
|
-
"eslint": "^9.
|
|
98
|
+
"eslint": "^9.37.0",
|
|
99
99
|
"eslint-config-prettier": "^10.1.8",
|
|
100
100
|
"eslint-plugin-prettier": "^5.5.4",
|
|
101
101
|
"jsdom": "^27.0.0",
|
|
102
102
|
"prettier": "^3.6.2",
|
|
103
|
-
"typescript": "^5.9.
|
|
104
|
-
"typescript-eslint": "^8.
|
|
103
|
+
"typescript": "^5.9.3",
|
|
104
|
+
"typescript-eslint": "^8.46.0",
|
|
105
105
|
"vitest": "^3.2.4"
|
|
106
106
|
},
|
|
107
107
|
"engines": {
|