Skip to content

Commit

Permalink
Add has property
Browse files Browse the repository at this point in the history
Ref: Level/community#142
Category: addition
  • Loading branch information
vweevers committed Dec 27, 2024
1 parent 9776ad0 commit d475678
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,28 @@ Does the database implement `db.snapshot()` and do read methods accept a `snapsh
| `classic-level` | Not yet |
| `memory-level` | Not yet |
| `browser-level` ||
| `many-level` | TBD |
| `rave-level` | TBD |

</details>

### `has` (boolean)

Does the database implement `has()` and `hasMany()`? Tracked in [Level/community#142](https://github.com/Level/community/issues/142).

<details>
<summary>Support matrix</summary>

| Module | Has |
| :-------------- | :------ |
| `classic-level` | Not yet |
| `memory-level` | Not yet |
| `browser-level` | Not yet |
| `many-level` | Not yet |
| `rave-level` | Not yet |

</details>

### `permanence` (boolean)

Does data survive after process (or environment) exit? Typically true. False for [`memory-level`](https://github.com/Level/memory-level).
Expand Down
5 changes: 5 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export interface IManifest {
*/
snapshots: boolean

/**
* Does the database implement `has()` and `hasMany()`?
*/
has: boolean

/**
* Does data survive after process (or environment) exit?
*/
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ exports.supports = function supports (...manifests) {
implicitSnapshots,
explicitSnapshots,
snapshots: implicitSnapshots,
has: manifest.has || false,
permanence: manifest.permanence || false,
seek: manifest.seek || false,
createIfMissing: manifest.createIfMissing || false,
Expand Down

0 comments on commit d475678

Please sign in to comment.