@cocreate/indexeddb 1.5.34 → 1.6.2
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 +21 -0
- package/package.json +4 -4
- package/src/index.js +28 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [1.6.2](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.6.1...v1.6.2) (2023-01-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* deployment ([4a29599](https://github.com/CoCreate-app/CoCreate-indexeddb/commit/4a295995ec24aa46a2361a35833c087635225177))
|
|
7
|
+
|
|
8
|
+
## [1.6.1](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.6.0...v1.6.1) (2023-01-28)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* const status to let status ([a7eb36c](https://github.com/CoCreate-app/CoCreate-indexeddb/commit/a7eb36cf2dede83194d86f4e0e49d23367b07922))
|
|
14
|
+
|
|
15
|
+
# [1.6.0](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.5.34...v1.6.0) (2023-01-28)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* indexeddb status ([7ba7ef5](https://github.com/CoCreate-app/CoCreate-indexeddb/commit/7ba7ef589509f8e9cbc18aeac511ee6d62040468))
|
|
21
|
+
|
|
1
22
|
## [1.5.34](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.5.33...v1.5.34) (2023-01-27)
|
|
2
23
|
|
|
3
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/indexeddb",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "A simple indexeddb component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"indexeddb",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"webpack-log": "^3.0.1"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@cocreate/docs": "^1.5.
|
|
64
|
-
"@cocreate/hosting": "^1.7.
|
|
65
|
-
"@cocreate/utils": "^1.17.
|
|
63
|
+
"@cocreate/docs": "^1.5.9",
|
|
64
|
+
"@cocreate/hosting": "^1.7.9",
|
|
65
|
+
"@cocreate/utils": "^1.17.22"
|
|
66
66
|
}
|
|
67
67
|
}
|
package/src/index.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
6
6
|
********************************************************************************/
|
|
7
7
|
import {ObjectId, dotNotationToObject, searchData, sortData, queryData} from '@cocreate/utils'
|
|
8
|
+
let status = true;
|
|
8
9
|
|
|
9
10
|
function createDatabase(data){
|
|
10
11
|
return Database('createDatabase', data)
|
|
@@ -1163,13 +1164,38 @@ function init() {
|
|
|
1163
1164
|
// Check for support.
|
|
1164
1165
|
if (!('indexedDB' in window)) {
|
|
1165
1166
|
console.log("This browser doesn't support IndexedDB.");
|
|
1167
|
+
setStatus(false);
|
|
1166
1168
|
return;
|
|
1167
|
-
} else {
|
|
1168
|
-
|
|
1169
|
+
} else {
|
|
1170
|
+
try {
|
|
1171
|
+
let openRequest = indexedDB.open('database');
|
|
1172
|
+
openRequest.onsuccess = function() {
|
|
1173
|
+
let db = openRequest.result;
|
|
1174
|
+
db.close()
|
|
1175
|
+
}
|
|
1176
|
+
if (window.CoCreateConfig)
|
|
1177
|
+
if (window.CoCreateConfig.indexeddb !== false)
|
|
1178
|
+
setStatus(true)
|
|
1179
|
+
} catch(e) {
|
|
1180
|
+
setStatus(false);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
function setStatus(value) {
|
|
1186
|
+
if (window.CoCreateConfig)
|
|
1187
|
+
window.CoCreateConfig.indexeddb = value;
|
|
1188
|
+
else
|
|
1189
|
+
window.CoCreateConfig = {indexeddb: value};
|
|
1190
|
+
|
|
1191
|
+
status = value;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1169
1194
|
|
|
1170
1195
|
init();
|
|
1171
1196
|
|
|
1172
1197
|
export default {
|
|
1198
|
+
status,
|
|
1173
1199
|
ObjectId,
|
|
1174
1200
|
getDatabase,
|
|
1175
1201
|
createDatabase,
|