You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is db an event emitter, as indicated by a truthy value? And does it support specific events as indicated by nested properties?
321
+
Which events does the database emit, as indicated by nested properties? For example:
322
322
323
323
```js
324
-
if (db.supports.events&&db.supports.events.open) {
325
-
db.once('open', () => { /* .. */})
324
+
if (db.supports.events.put) {
325
+
db.on('put', () => { /* .. */})
326
326
}
327
327
```
328
328
@@ -353,23 +353,26 @@ Does db have the methods `createReadStream`, `createKeyStream` and `createValueS
353
353
354
354
</details>
355
355
356
-
### `encodings` (boolean or object)
356
+
### `encodings` (object)
357
357
358
-
Do all relevant db methods take `keyEncoding` and `valueEncoding` options? If truthy, the db must use a default encoding of utf8 and all its operations must return strings rather than buffers by default.
359
-
360
-
Support of individual encodings may also be indicated by adding their names as nested properties. For example:
358
+
Which encodings (by name) does the database support, as indicated by nested properties? For example:
361
359
362
360
```js
363
361
{
364
362
encodings: {
365
-
utf8:true
363
+
utf8:true,
364
+
json:true
366
365
}
367
366
}
368
367
```
369
368
369
+
As the `encodings` property cannot be false (anymore, since `level-supports` v3.0.0) it implies that the database supports `keyEncoding` and `valueEncoding` options on all relevant methods, uses a default encoding of utf8 and that hence all of its read operations return strings rather than buffers by default.
370
+
370
371
<details>
371
372
<summary>Support matrix</summary>
372
373
374
+
At the moment, this matrix just indicates general support of encodings, not that the listed modules support the `encodings` property exactly as described above.
0 commit comments