Skip to content

Commit 7601e45

Browse files
committed
docs(readme): fix entry deletion
wrong header
1 parent 2936ae5 commit 7601e45

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

README.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ KdbxWeb is a high-performance javascript library for reading/writing KeePass v2
1717
- [Loading](#loading)
1818
- [Saving](#saving)
1919
- [File info](#file-info)
20-
- [Changing credentials](#changing-credentials)
20+
- [Changing Credentials](#changing-credentials)
2121
- [Creation](#creation)
2222
- [Maintenance](#maintenance)
2323
- [Merge](#merge)
2424
- [Groups](#groups)
25-
- [Group creation](#group-creation)
26-
- [Group deletion](#group-deletion)
27-
- [Group move](#group-move)
25+
- [Group Creation](#group-creation)
26+
- [Group Deletion](#group-deletion)
27+
- [Group Move](#group-move)
2828
- [Recycle Bin](#recycle-bin)
29-
- [Recursive traverse](#recursive-traverse)
29+
- [Recursive Traverse](#recursive-traverse)
3030
- [Entries](#entries)
31-
- [Entry creation](#entry-creation)
32-
- [Entry modification](#entry-modification)
33-
- [Entry deletion](#entry-deletion)
34-
- [Entry move](#entry-move)
31+
- [Entry Creation](#entry-creation)
32+
- [Entry Modification](#entry-modification)
33+
- [Entry Deletion](#entry-deletion)
34+
- [Entry Move](#entry-move)
3535
- [ProtectedValue](#protectedvalue)
3636
- [Errors](#errors)
3737
- [Consts](#consts)
@@ -158,7 +158,7 @@ db.meta
158158

159159
See the corresponding type fields inside, they should be obvious.
160160

161-
### Changing credentials
161+
### Changing Credentials
162162

163163
```ts
164164
const db = await kdbxweb.Kdbx.load(data, credentials);
@@ -211,14 +211,18 @@ let db = await kdbxweb.Kdbx.load(data, credentials); // load local db
211211
db.save(); // save local db
212212
let editStateBeforeSave = db.getLocalEditState(); // save local editing state (serializable to JSON)
213213
db.close(); // close local db
214+
214215
db = kdbxweb.Kdbx.load(data, credentials); // reopen it again
215216
db.setLocalEditState(editStateBeforeSave); // assign edit state obtained before save
217+
216218
// work with db
217219
let remoteDb = await kdbxweb.Kdbx.load(remoteData, credentials); // load remote db
218220
db.merge(remoteDb); // merge remote into local
219221
delete remoteDb; // don't use remoteDb anymore
222+
220223
let saved = await db.save(); // save local db
221224
editStateBeforeSave = db.getLocalEditState(); // save local editing state again
225+
222226
let pushedOk = pushToUpstream(saved); // push db to upstream
223227
if (pushedOk) {
224228
db.removeLocalEditState(); // clear local editing state
@@ -238,7 +242,7 @@ let deepGroup = defaultGroup.groups[1].groups[2];
238242

239243
<br />
240244

241-
### Group creation
245+
### Group Creation
242246

243247
```ts
244248
let group = db.createGroup(db.getDefaultGroup(), 'New group');
@@ -247,15 +251,15 @@ let anotherGroup = db.createGroup(group, 'Subgroup');
247251

248252
<br />
249253

250-
### Group deletion
254+
### Group Deletion
251255

252256
```ts
253257
db.remove(group);
254258
```
255259

256260
<br />
257261

258-
### Group move
262+
### Group Move
259263

260264
```ts
261265
db.move(group, toGroup);
@@ -275,7 +279,7 @@ if (!recycleBin) {
275279

276280
<br />
277281

278-
### Recursive traverse
282+
### Recursive Traverse
279283

280284
```ts
281285
for (const entry of group.allEntries()) { /* ... */ }
@@ -295,15 +299,15 @@ entry.fields.Pin = kdbxweb.ProtectedValue.fromString('4321');
295299

296300
<br />
297301

298-
### Entry creation
302+
### Entry Creation
299303

300304
```ts
301305
let entry = db.createEntry(group);
302306
```
303307

304308
<br />
305309

306-
### Entry modification
310+
### Entry Modification
307311

308312
```ts
309313
// push current state to history stack
@@ -326,15 +330,15 @@ entry.removeHistory(index, count);
326330
327331
<br />
328332

329-
##### Entry deletion
333+
### Entry Deletion
330334

331335
```ts
332336
db.remove(entry);
333337
```
334338

335339
<br />
336340

337-
### Entry move
341+
### Entry Move
338342

339343
```ts
340344
db.move(entry, toGroup);

0 commit comments

Comments
 (0)