idb-ts 0.0.1 → 2.0.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/README.md +76 -1
- package/index.ts +188 -1
- package/lib/index.d.ts +28 -0
- package/lib/index.js +189 -1
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -1 +1,76 @@
|
|
|
1
|
-
# ts
|
|
1
|
+
# idb-ts
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
```
|
|
5
|
+
npm i idb-ts
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
## Example
|
|
9
|
+
|
|
10
|
+
### Declaring entity
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
@DataClass()
|
|
14
|
+
class User {
|
|
15
|
+
@KeyPath()
|
|
16
|
+
name: string;
|
|
17
|
+
age: number;
|
|
18
|
+
cell?: string;
|
|
19
|
+
address: string;
|
|
20
|
+
|
|
21
|
+
constructor(name: string, age: number, address: string, cell?: string) {
|
|
22
|
+
this.name = name;
|
|
23
|
+
this.age = age;
|
|
24
|
+
this.address = address;
|
|
25
|
+
this.cell = cell;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@DataClass()
|
|
30
|
+
class Location {
|
|
31
|
+
@KeyPath()
|
|
32
|
+
id: string;
|
|
33
|
+
city: string;
|
|
34
|
+
country: string;
|
|
35
|
+
|
|
36
|
+
constructor(id: string, city: string, country: string) {
|
|
37
|
+
this.id = id;
|
|
38
|
+
this.city = city;
|
|
39
|
+
this.country = country;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### CRUD on DB
|
|
45
|
+
```
|
|
46
|
+
const db = new Database("idb-crud", [User, Location]);
|
|
47
|
+
|
|
48
|
+
const alice = new User("Alice", 25, "123 Main St");
|
|
49
|
+
const nyc = new Location("1", "New York", "USA");
|
|
50
|
+
|
|
51
|
+
await db.create(User, alice);
|
|
52
|
+
await db.create(Location, nyc);
|
|
53
|
+
|
|
54
|
+
const readAlice = await db.read(User, "Alice");
|
|
55
|
+
console.log("Read user:", readAlice);
|
|
56
|
+
|
|
57
|
+
alice.age = 26;
|
|
58
|
+
alice.address = "789 Maple St";
|
|
59
|
+
await db.update(User, alice);
|
|
60
|
+
|
|
61
|
+
const users = await db.list(User);
|
|
62
|
+
console.log("All users:", users);
|
|
63
|
+
|
|
64
|
+
await db.delete(User, "Alice");
|
|
65
|
+
console.log("User Alice deleted.");
|
|
66
|
+
|
|
67
|
+
const remainingUsers = await db.list(User);
|
|
68
|
+
console.log("Remaining users:", remainingUsers);
|
|
69
|
+
|
|
70
|
+
const locations = await db.list(Location);
|
|
71
|
+
console.log("All locations:", locations);
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Links
|
|
75
|
+
- GitHub: https://github.com/maifeeulasad/idb-ts
|
|
76
|
+
- NPM: https://www.npmjs.com/package/idb-ts
|
package/index.ts
CHANGED
|
@@ -1 +1,188 @@
|
|
|
1
|
-
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
|
|
3
|
+
function KeyPath(): PropertyDecorator {
|
|
4
|
+
return (target: Object, propertyKey: string | symbol) => {
|
|
5
|
+
const constructor = target.constructor as Function;
|
|
6
|
+
Reflect.defineMetadata("keypath", [propertyKey as string], constructor);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function DataClass(): ClassDecorator {
|
|
11
|
+
return (target: Function) => {
|
|
12
|
+
if (!Reflect.getMetadata("keypath", target)) {
|
|
13
|
+
throw new Error(`No keypath field defined for the class ${target.name}.`);
|
|
14
|
+
}
|
|
15
|
+
const keyPathFields = Reflect.getMetadata("keypath", target) || [];
|
|
16
|
+
if (keyPathFields.length > 1) {
|
|
17
|
+
throw new Error(`Only one keypath field can be defined for the class ${target.name}.`);
|
|
18
|
+
}
|
|
19
|
+
Reflect.defineMetadata("dataclass", true, target);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
class Database {
|
|
24
|
+
private dbName: string;
|
|
25
|
+
private classes: Function[];
|
|
26
|
+
private db: IDBDatabase | null = null;
|
|
27
|
+
|
|
28
|
+
private constructor(dbName: string, classes: Function[]) {
|
|
29
|
+
this.dbName = dbName;
|
|
30
|
+
if (!classes.every(cls => Reflect.getMetadata("dataclass", cls))) {
|
|
31
|
+
throw new Error("All classes should be decorated with @DataClass.");
|
|
32
|
+
}
|
|
33
|
+
this.classes = classes;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static async build(dbName: string, classes: Function[]): Promise<Database> {
|
|
37
|
+
const instance = new Database(dbName, classes);
|
|
38
|
+
await instance.initDB();
|
|
39
|
+
return instance;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
private async initDB(): Promise<void> {
|
|
43
|
+
return new Promise((resolve, reject) => {
|
|
44
|
+
const request = indexedDB.open(this.dbName, 1);
|
|
45
|
+
|
|
46
|
+
request.onupgradeneeded = () => {
|
|
47
|
+
const db = request.result;
|
|
48
|
+
|
|
49
|
+
this.classes.forEach((cls) => {
|
|
50
|
+
const keyPathFields = Reflect.getMetadata("keypath", cls) || [];
|
|
51
|
+
|
|
52
|
+
const storeName = cls.name.toLowerCase() + "s";
|
|
53
|
+
|
|
54
|
+
if (!db.objectStoreNames.contains(storeName)) {
|
|
55
|
+
db.createObjectStore(storeName, { keyPath: keyPathFields[0] });
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
request.onsuccess = () => {
|
|
61
|
+
this.db = request.result;
|
|
62
|
+
console.log(`Database initialized with object stores for: ${this.classes.map(cls => cls.name).join(", ")}`);
|
|
63
|
+
resolve();
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
request.onerror = () => {
|
|
67
|
+
console.error("Error initializing database:", request.error);
|
|
68
|
+
reject(request.error);
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private getObjectStore(className: string, mode: IDBTransactionMode): IDBObjectStore {
|
|
74
|
+
if (!this.db) {
|
|
75
|
+
throw new Error("Database not initialized.");
|
|
76
|
+
}
|
|
77
|
+
const storeName = className.toLowerCase() + "s";
|
|
78
|
+
const transaction = this.db.transaction(storeName, mode);
|
|
79
|
+
return transaction.objectStore(storeName);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async create<T>(cls: { new(...args: any[]): T }, item: T): Promise<void> {
|
|
83
|
+
return new Promise((resolve, reject) => {
|
|
84
|
+
try {
|
|
85
|
+
const store = this.getObjectStore(cls.name, "readwrite");
|
|
86
|
+
const request = store.add(item);
|
|
87
|
+
|
|
88
|
+
request.onsuccess = () => {
|
|
89
|
+
console.log(`Item added to ${cls.name}:`, item);
|
|
90
|
+
resolve();
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
request.onerror = () => {
|
|
94
|
+
console.error(`Error adding item to ${cls.name}:`, request.error);
|
|
95
|
+
reject(request.error);
|
|
96
|
+
};
|
|
97
|
+
} catch (error) {
|
|
98
|
+
reject(error);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async read<T>(cls: { new(...args: any[]): T }, key: string): Promise<T | undefined> {
|
|
104
|
+
return new Promise((resolve, reject) => {
|
|
105
|
+
try {
|
|
106
|
+
const store = this.getObjectStore(cls.name, "readonly");
|
|
107
|
+
const request = store.get(key);
|
|
108
|
+
|
|
109
|
+
request.onsuccess = () => {
|
|
110
|
+
console.log(`Item read from ${cls.name}:`, request.result);
|
|
111
|
+
resolve(request.result as T | undefined);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
request.onerror = () => {
|
|
115
|
+
console.error(`Error reading item from ${cls.name}:`, request.error);
|
|
116
|
+
reject(request.error);
|
|
117
|
+
};
|
|
118
|
+
} catch (error) {
|
|
119
|
+
reject(error);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
async update<T>(cls: { new(...args: any[]): T }, item: T): Promise<void> {
|
|
125
|
+
return new Promise((resolve, reject) => {
|
|
126
|
+
try {
|
|
127
|
+
const store = this.getObjectStore(cls.name, "readwrite");
|
|
128
|
+
const request = store.put(item);
|
|
129
|
+
|
|
130
|
+
request.onsuccess = () => {
|
|
131
|
+
console.log(`Item updated in ${cls.name}:`, item);
|
|
132
|
+
resolve();
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
request.onerror = () => {
|
|
136
|
+
console.error(`Error updating item in ${cls.name}:`, request.error);
|
|
137
|
+
reject(request.error);
|
|
138
|
+
};
|
|
139
|
+
} catch (error) {
|
|
140
|
+
reject(error);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async delete<T>(cls: { new(...args: any[]): T }, key: string): Promise<void> {
|
|
146
|
+
return new Promise((resolve, reject) => {
|
|
147
|
+
try {
|
|
148
|
+
const store = this.getObjectStore(cls.name, "readwrite");
|
|
149
|
+
const request = store.delete(key);
|
|
150
|
+
|
|
151
|
+
request.onsuccess = () => {
|
|
152
|
+
console.log(`Item deleted from ${cls.name}:`, key);
|
|
153
|
+
resolve();
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
request.onerror = () => {
|
|
157
|
+
console.error(`Error deleting item from ${cls.name}:`, request.error);
|
|
158
|
+
reject(request.error);
|
|
159
|
+
};
|
|
160
|
+
} catch (error) {
|
|
161
|
+
reject(error);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
async list<T>(cls: { new(...args: any[]): T }): Promise<T[]> {
|
|
167
|
+
return new Promise((resolve, reject) => {
|
|
168
|
+
try {
|
|
169
|
+
const store = this.getObjectStore(cls.name, "readonly");
|
|
170
|
+
const request = store.getAll();
|
|
171
|
+
|
|
172
|
+
request.onsuccess = () => {
|
|
173
|
+
console.log(`All items from ${cls.name}:`, request.result);
|
|
174
|
+
resolve(request.result as T[]);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
request.onerror = () => {
|
|
178
|
+
console.error(`Error listing items from ${cls.name}:`, request.error);
|
|
179
|
+
reject(request.error);
|
|
180
|
+
};
|
|
181
|
+
} catch (error) {
|
|
182
|
+
reject(error);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export { Database, KeyPath, DataClass };
|
package/lib/index.d.ts
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
declare function KeyPath(): PropertyDecorator;
|
|
3
|
+
declare function DataClass(): ClassDecorator;
|
|
4
|
+
declare class Database {
|
|
5
|
+
private dbName;
|
|
6
|
+
private classes;
|
|
7
|
+
private db;
|
|
8
|
+
private constructor();
|
|
9
|
+
static build(dbName: string, classes: Function[]): Promise<Database>;
|
|
10
|
+
private initDB;
|
|
11
|
+
private getObjectStore;
|
|
12
|
+
create<T>(cls: {
|
|
13
|
+
new (...args: any[]): T;
|
|
14
|
+
}, item: T): Promise<void>;
|
|
15
|
+
read<T>(cls: {
|
|
16
|
+
new (...args: any[]): T;
|
|
17
|
+
}, key: string): Promise<T | undefined>;
|
|
18
|
+
update<T>(cls: {
|
|
19
|
+
new (...args: any[]): T;
|
|
20
|
+
}, item: T): Promise<void>;
|
|
21
|
+
delete<T>(cls: {
|
|
22
|
+
new (...args: any[]): T;
|
|
23
|
+
}, key: string): Promise<void>;
|
|
24
|
+
list<T>(cls: {
|
|
25
|
+
new (...args: any[]): T;
|
|
26
|
+
}): Promise<T[]>;
|
|
27
|
+
}
|
|
28
|
+
export { Database, KeyPath, DataClass };
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,190 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DataClass = exports.KeyPath = exports.Database = void 0;
|
|
13
|
+
require("reflect-metadata");
|
|
14
|
+
function KeyPath() {
|
|
15
|
+
return (target, propertyKey) => {
|
|
16
|
+
const constructor = target.constructor;
|
|
17
|
+
Reflect.defineMetadata("keypath", [propertyKey], constructor);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
exports.KeyPath = KeyPath;
|
|
21
|
+
function DataClass() {
|
|
22
|
+
return (target) => {
|
|
23
|
+
if (!Reflect.getMetadata("keypath", target)) {
|
|
24
|
+
throw new Error(`No keypath field defined for the class ${target.name}.`);
|
|
25
|
+
}
|
|
26
|
+
const keyPathFields = Reflect.getMetadata("keypath", target) || [];
|
|
27
|
+
if (keyPathFields.length > 1) {
|
|
28
|
+
throw new Error(`Only one keypath field can be defined for the class ${target.name}.`);
|
|
29
|
+
}
|
|
30
|
+
Reflect.defineMetadata("dataclass", true, target);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
exports.DataClass = DataClass;
|
|
34
|
+
class Database {
|
|
35
|
+
constructor(dbName, classes) {
|
|
36
|
+
this.db = null;
|
|
37
|
+
this.dbName = dbName;
|
|
38
|
+
if (!classes.every(cls => Reflect.getMetadata("dataclass", cls))) {
|
|
39
|
+
throw new Error("All classes should be decorated with @DataClass.");
|
|
40
|
+
}
|
|
41
|
+
this.classes = classes;
|
|
42
|
+
}
|
|
43
|
+
static build(dbName, classes) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const instance = new Database(dbName, classes);
|
|
46
|
+
yield instance.initDB();
|
|
47
|
+
return instance;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
initDB() {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
return new Promise((resolve, reject) => {
|
|
53
|
+
const request = indexedDB.open(this.dbName, 1);
|
|
54
|
+
request.onupgradeneeded = () => {
|
|
55
|
+
const db = request.result;
|
|
56
|
+
this.classes.forEach((cls) => {
|
|
57
|
+
const keyPathFields = Reflect.getMetadata("keypath", cls) || [];
|
|
58
|
+
const storeName = cls.name.toLowerCase() + "s";
|
|
59
|
+
if (!db.objectStoreNames.contains(storeName)) {
|
|
60
|
+
db.createObjectStore(storeName, { keyPath: keyPathFields[0] });
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
request.onsuccess = () => {
|
|
65
|
+
this.db = request.result;
|
|
66
|
+
console.log(`Database initialized with object stores for: ${this.classes.map(cls => cls.name).join(", ")}`);
|
|
67
|
+
resolve();
|
|
68
|
+
};
|
|
69
|
+
request.onerror = () => {
|
|
70
|
+
console.error("Error initializing database:", request.error);
|
|
71
|
+
reject(request.error);
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
getObjectStore(className, mode) {
|
|
77
|
+
if (!this.db) {
|
|
78
|
+
throw new Error("Database not initialized.");
|
|
79
|
+
}
|
|
80
|
+
const storeName = className.toLowerCase() + "s";
|
|
81
|
+
const transaction = this.db.transaction(storeName, mode);
|
|
82
|
+
return transaction.objectStore(storeName);
|
|
83
|
+
}
|
|
84
|
+
create(cls, item) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
return new Promise((resolve, reject) => {
|
|
87
|
+
try {
|
|
88
|
+
const store = this.getObjectStore(cls.name, "readwrite");
|
|
89
|
+
const request = store.add(item);
|
|
90
|
+
request.onsuccess = () => {
|
|
91
|
+
console.log(`Item added to ${cls.name}:`, item);
|
|
92
|
+
resolve();
|
|
93
|
+
};
|
|
94
|
+
request.onerror = () => {
|
|
95
|
+
console.error(`Error adding item to ${cls.name}:`, request.error);
|
|
96
|
+
reject(request.error);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
reject(error);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
read(cls, key) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
return new Promise((resolve, reject) => {
|
|
108
|
+
try {
|
|
109
|
+
const store = this.getObjectStore(cls.name, "readonly");
|
|
110
|
+
const request = store.get(key);
|
|
111
|
+
request.onsuccess = () => {
|
|
112
|
+
console.log(`Item read from ${cls.name}:`, request.result);
|
|
113
|
+
resolve(request.result);
|
|
114
|
+
};
|
|
115
|
+
request.onerror = () => {
|
|
116
|
+
console.error(`Error reading item from ${cls.name}:`, request.error);
|
|
117
|
+
reject(request.error);
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
reject(error);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
update(cls, item) {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
return new Promise((resolve, reject) => {
|
|
129
|
+
try {
|
|
130
|
+
const store = this.getObjectStore(cls.name, "readwrite");
|
|
131
|
+
const request = store.put(item);
|
|
132
|
+
request.onsuccess = () => {
|
|
133
|
+
console.log(`Item updated in ${cls.name}:`, item);
|
|
134
|
+
resolve();
|
|
135
|
+
};
|
|
136
|
+
request.onerror = () => {
|
|
137
|
+
console.error(`Error updating item in ${cls.name}:`, request.error);
|
|
138
|
+
reject(request.error);
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
reject(error);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
delete(cls, key) {
|
|
148
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
149
|
+
return new Promise((resolve, reject) => {
|
|
150
|
+
try {
|
|
151
|
+
const store = this.getObjectStore(cls.name, "readwrite");
|
|
152
|
+
const request = store.delete(key);
|
|
153
|
+
request.onsuccess = () => {
|
|
154
|
+
console.log(`Item deleted from ${cls.name}:`, key);
|
|
155
|
+
resolve();
|
|
156
|
+
};
|
|
157
|
+
request.onerror = () => {
|
|
158
|
+
console.error(`Error deleting item from ${cls.name}:`, request.error);
|
|
159
|
+
reject(request.error);
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
reject(error);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
list(cls) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
return new Promise((resolve, reject) => {
|
|
171
|
+
try {
|
|
172
|
+
const store = this.getObjectStore(cls.name, "readonly");
|
|
173
|
+
const request = store.getAll();
|
|
174
|
+
request.onsuccess = () => {
|
|
175
|
+
console.log(`All items from ${cls.name}:`, request.result);
|
|
176
|
+
resolve(request.result);
|
|
177
|
+
};
|
|
178
|
+
request.onerror = () => {
|
|
179
|
+
console.error(`Error listing items from ${cls.name}:`, request.error);
|
|
180
|
+
reject(request.error);
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
reject(error);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
exports.Database = Database;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "idb-ts",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Easy CRUD for indexed-db, written in TypeScript",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -21,9 +21,12 @@
|
|
|
21
21
|
"bugs": {
|
|
22
22
|
"url": "https://github.com/maifeeulasad/idb-crud/issues"
|
|
23
23
|
},
|
|
24
|
-
"files": [
|
|
24
|
+
"files": [
|
|
25
|
+
"lib"
|
|
26
|
+
],
|
|
25
27
|
"homepage": "https://github.com/maifeeulasad/idb-crud#readme",
|
|
26
28
|
"devDependencies": {
|
|
29
|
+
"reflect-metadata": "^0.2.2",
|
|
27
30
|
"typescript": "^4.6.3"
|
|
28
31
|
}
|
|
29
|
-
}
|
|
32
|
+
}
|