@cocreate/indexeddb 1.7.1 → 1.7.3
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 +14 -0
- package/package.json +4 -4
- package/src/index.js +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.7.3](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.7.2...v1.7.3) (2023-03-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* readDatabase - data not defined add empty object ([b2a2c69](https://github.com/CoCreate-app/CoCreate-indexeddb/commit/b2a2c6945f9ecca466681b75829f15c1fb822714))
|
|
7
|
+
|
|
8
|
+
## [1.7.2](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.7.1...v1.7.2) (2023-03-16)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bump dependencies' ([71b7746](https://github.com/CoCreate-app/CoCreate-indexeddb/commit/71b77467e3f13714e7c656f70ca7e0bfa6ebf124))
|
|
14
|
+
|
|
1
15
|
## [1.7.1](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.7.0...v1.7.1) (2023-03-16)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/indexeddb",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
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.6.
|
|
64
|
-
"@cocreate/hosting": "^1.8.
|
|
65
|
-
"@cocreate/utils": "^1.19.
|
|
63
|
+
"@cocreate/docs": "^1.6.1",
|
|
64
|
+
"@cocreate/hosting": "^1.8.1",
|
|
65
|
+
"@cocreate/utils": "^1.19.1"
|
|
66
66
|
}
|
|
67
67
|
}
|
package/src/index.js
CHANGED
|
@@ -11,7 +11,7 @@ function createDatabase(data){
|
|
|
11
11
|
return Database('createDatabase', data)
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const readDatabase = () => {
|
|
14
|
+
const readDatabase = (data) => {
|
|
15
15
|
return Database('readDatabase', data)
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -32,7 +32,7 @@ const Database = (action, data) => {
|
|
|
32
32
|
return new Promise((resolve, reject) => {
|
|
33
33
|
let type = 'database'
|
|
34
34
|
let databaseArray = [];
|
|
35
|
-
|
|
35
|
+
if (!data) data = {}
|
|
36
36
|
if (data.request)
|
|
37
37
|
data[type] = data.request
|
|
38
38
|
|
|
@@ -41,10 +41,13 @@ const Database = (action, data) => {
|
|
|
41
41
|
|
|
42
42
|
if (action == 'readDatabase') {
|
|
43
43
|
indexedDB.databases().then((databases) => {
|
|
44
|
-
for (let database of databases){
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
for (let database of databases) {
|
|
45
|
+
if (data.filter && data.filter.query) {
|
|
46
|
+
let isFilter = queryData(database, data.filter.query)
|
|
47
|
+
if (isFilter)
|
|
48
|
+
databaseArray.push({ database, db: 'indexeddb' })
|
|
49
|
+
} else
|
|
50
|
+
databaseArray.push({ database, db: 'indexeddb' })
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
resolve(createData(data, databaseArray, type))
|