FRE-600: Fix code review blockers

- Consolidated duplicate UndoManagers to single instance
- Fixed connection promise to only resolve on 'connected' status
- Fixed WebSocketProvider import (WebsocketProvider)
- Added proper doc.destroy() cleanup
- Renamed isPresenceInitialized property to avoid conflict

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-25 00:08:01 -04:00
parent 65b552bb08
commit 7c684a42cc
48450 changed files with 5679671 additions and 383 deletions

448
node_modules/level/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,448 @@
# Changelog
_**If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md)._
## [6.0.1] - 2020-03-04
### Changed
- Switch from `opencollective-postinstall` to npm `funding` ([#173](https://github.com/Level/level/issues/173)) ([**@Richienb**](https://github.com/Richienb))
- Upgrade `nyc` devDependency from `^14.0.0` to `^15.0.0` ([#169](https://github.com/Level/level/issues/169)) ([**@vweevers**](https://github.com/vweevers))
- Upgrade `airtap` devDependency from `^2.0.1` to `^3.0.0` ([#171](https://github.com/Level/level/issues/171)) ([**@vweevers**](https://github.com/vweevers))
## [6.0.0] - 2019-10-19
### Changed
- **Breaking:** upgrade `level-js` from `^4.0.0` to `^5.0.0` ([#158](https://github.com/Level/level/issues/158)) ([**@vweevers**](https://github.com/vweevers))
- Upgrade `hallmark` devDependency from `^0.1.0` to `^2.0.0` ([#152](https://github.com/Level/level/issues/152), [#157](https://github.com/Level/level/issues/157)) ([**@vweevers**](https://github.com/vweevers))
- Upgrade `standard` devDependency from `^12.0.0` to `^14.0.0` ([#151](https://github.com/Level/level/issues/151), [#155](https://github.com/Level/level/issues/155)) ([**@vweevers**](https://github.com/vweevers))
- Upgrade `nyc` devDependency from `^13.2.0` to `^14.0.0` ([#147](https://github.com/Level/level/issues/147)) ([**@vweevers**](https://github.com/vweevers))
### Added
- Document manifest, `iterator()` and `clear()` ([#162](https://github.com/Level/level/issues/162)) ([**@vweevers**](https://github.com/vweevers))
- Add links to `browserify-starter` and `webpack-starter` ([`6ff1802`](https://github.com/Level/level/commit/6ff1802)) ([**@vweevers**](https://github.com/vweevers))
### Fixed
- Bump `leveldown` and `level-packager` to prevent dedupe ([`5efdc82`](https://github.com/Level/level/commit/5efdc82), [`a9656c3`](https://github.com/Level/level/commit/a9656c3), [`97cb31c`](https://github.com/Level/level/commit/97cb31c)) ([**@vweevers**](https://github.com/vweevers))
## [5.0.1] - 2019-03-29
### Fixed
- Temporarily skip `hallmark` test because it breaks CITGM ([#145](https://github.com/Level/level/issues/145)) ([**@vweevers**](https://github.com/vweevers))
## [5.0.0] - 2019-03-29
### Changed
- Upgrade `leveldown` from `^4.0.0` to `^5.0.0` ([#133](https://github.com/Level/level/issues/133), [#144](https://github.com/Level/level/issues/144)) ([**@vweevers**](https://github.com/vweevers))
- Upgrade `level-packager` from `^3.0.0` to `^5.0.0` ([#113](https://github.com/Level/level/issues/113), [#131](https://github.com/Level/level/issues/131)) ([**@ralphtheninja**](https://github.com/ralphtheninja), [**@vweevers**](https://github.com/vweevers))
- Prefer `var` over `const` in README ([`f032b6c`](https://github.com/Level/level/commit/f032b6c)) ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Upgrade `standard` devDependency from `^11.0.0` to `^12.0.0` ([#118](https://github.com/Level/level/issues/118)) ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Tweak copyright years for less maintenance ([`0b9c8ad`](https://github.com/Level/level/commit/0b9c8ad)) ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Tweak Open Collective documentation ([#137](https://github.com/Level/level/issues/137)) ([**@vweevers**](https://github.com/vweevers))
- Apply common project tweaks ([#136](https://github.com/Level/level/issues/136), [#138](https://github.com/Level/level/issues/138)) ([**@vweevers**](https://github.com/vweevers))
- Add `.travis.yml` and `appveyor.yml` to `.npmignore` ([`7b5c340`](https://github.com/Level/level/commit/7b5c340)) ([**@vweevers**](https://github.com/vweevers))
### Added
- Integrate `level-js` for browser support ([#135](https://github.com/Level/level/issues/135)) ([**@vweevers**](https://github.com/vweevers))
- Add appveyor ([#112](https://github.com/Level/level/issues/112)) ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Enable OSX on Travis ([#111](https://github.com/Level/level/issues/111)) ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Add `nyc` and `coveralls` devDependencies ([#115](https://github.com/Level/level/issues/115), [#143](https://github.com/Level/level/issues/143)) ([**@ralphtheninja**](https://github.com/ralphtheninja), [**@vweevers**](https://github.com/vweevers))
- Add `hallmark` devDependency ([#134](https://github.com/Level/level/issues/134)) ([**@vweevers**](https://github.com/vweevers))
- Add note about Rollup to `README.md` ([#139](https://github.com/Level/level/issues/139)) ([**@vweevers**](https://github.com/vweevers))
### Removed
- Remove node 6 and 9 ([#129](https://github.com/Level/level/issues/129), [`2bf1d3f`](https://github.com/Level/level/commit/2bf1d3f)) ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Remove contributors from `package.json` ([`f37252d`](https://github.com/Level/level/commit/f37252d)) ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [4.0.0] - 2018-05-23
### Changed
- Update `leveldown` to `^4.0.0` ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Update `level-packager` to `^3.0.0` ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Switch to `opencollective-postinstall` ([**@mateodelnorte**](https://github.com/mateodelnorte))
### Removed
- Remove node 4 from Travis ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [3.0.2] - 2018-05-23
### Changed
- Switch to `opencollective-postinstall` ([**@mateodelnorte**](https://github.com/mateodelnorte))
## [3.0.1] - 2018-05-05
### Added
- Travis: add 10 ([**@ralphtheninja**](https://github.com/ralphtheninja))
### Changed
- Update `standard` to `^11.0.0` ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Fix typo in README ([**@rasmuserik**](https://github.com/rasmuserik))
### Fixed
- Fix postinstall failures with OpenCollective ([**@vweevers**](https://github.com/vweevers))
## [3.0.0] - 2018-02-17
### Added
- Travis: add 9 ([**@ralphtheninja**](https://github.com/ralphtheninja))
- README: add table of contents ([**@ralphtheninja**](https://github.com/ralphtheninja))
### Changed
- Update `leveldown` to `^3.0.0` ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [2.1.2] - 2018-01-26
### Added
- Add OpenCollective ([**@monkeywithacupcake**](https://github.com/monkeywithacupcake))
### Changed
- README: change Travis badge from png to svg ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [2.1.1] - 2017-12-13
### Changed
- README: document `.errors` property ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [2.1.0] - 2017-12-06
### Changed
- Update `level-packager` to `^2.0.2` ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Update `leveldown` to `^2.1.1` ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [2.0.1] - 2017-11-11
### Changed
- Restore node 4 ([**@vweevers**](https://github.com/vweevers))
## [2.0.0] - 2017-10-17
### Added
- Add `standard` for linting ([**@ralphtheninja**](https://github.com/ralphtheninja))
- README: copy over docs from `levelup` ([**@ralphtheninja**](https://github.com/ralphtheninja))
- README: add node badge ([**@ralphtheninja**](https://github.com/ralphtheninja))
### Changed
- Update `level-packager` to `~2.0.0` ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Update `leveldown` to `~2.0.0` ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [2.0.0-rc3] - 2017-09-16
### Changed
- Update `level-packager` to `2.0.0-rc3` ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Update `leveldown` to `~1.8.0` ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [2.0.0-rc2] - 2017-09-12
### Changed
- Update `level-packager` to `2.0.0-rc2` ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Update `leveldown` to `~1.7.2` ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [2.0.0-rc1] - 2017-09-06
### Added
- README: add Greenkeeper badge ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Travis: add 8 ([**@ralphtheninja**](https://github.com/ralphtheninja))
### Changed
- Update `level-packager` to `2.0.0-rc1` ([**@ralphtheninja**](https://github.com/ralphtheninja))
### Removed
- Travis: remove 0.12, 4, 5, and 7 ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [1.7.0] - 2017-05-17
### Changed
- Update `leveldown` to `~1.7.0` ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [1.6.0] - 2017-02-06
### Added
- Travis: add 7 ([**@ralphtheninja**](https://github.com/ralphtheninja))
### Changed
- Update copyright year to 2017 ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Update `leveldown` to `~1.6.0` ([**@ralphtheninja**](https://github.com/ralphtheninja))
### Removed
- Travis: remove 0.10 ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [1.5.0] - 2016-10-16
### Added
- Travis: add 6 ([**@ralphtheninja**](https://github.com/ralphtheninja))
### Changed
- Use gcc 4.8 on Travis
- Update `leveldown` to `~1.5.0` ([**@juliangruber**](https://github.com/juliangruber))
### Removed
- Travis: remove 1.0, 1.8, 2 and 3 ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [1.4.0] - 2015-11-27
### Added
- Travis: add 1.0, 2, 3, 4 and 5 ([**@ralphtheninja**](https://github.com/ralphtheninja))
- README: add dependency badge ([**@ralphtheninja**](https://github.com/ralphtheninja))
### Changed
- Update `level-packager` to `~1.2.0` ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [1.3.0] - 2015-07-29
### Changed
- Update `leveldown` to `~1.4.0` ([**@ArtskydJ**](https://github.com/ArtskydJ))
## [1.2.0] - 2015-06-24
### Changed
- Update `level-packager` to `~1.1.0` ([**@timoxley**](https://github.com/timoxley))
- Update `leveldown` to `~1.3.0` ([**@timoxley**](https://github.com/timoxley))
## [1.1.0] - 2015-06-02
### Changed
- Update `leveldown` to `~1.2.2` for prebuilt binaries ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [1.0.0] - 2015-05-19
### Changed
- Update `level-packager` to `~1.0.0` ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [1.0.0-0] - 2015-05-16
### Changed
- Use `nvm` again on Travis ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Moved `CONTRIBUTING.md` and contributors to `level/community` repository ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Use `level-packager@next` ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Update `leveldown` to `~1.0.6` ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [0.19.1] - 2015-05-05
### Changed
- Use `n` instead of `nvm` on Travis for iojs support on native modules ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [0.19.0] - 2015-05-05
### Changed
- Switch to plain MIT license ([**@andrewrk**](https://github.com/andrewrk))
- README: update nodeico badge ([**@rvagg**](https://github.com/rvagg))
- README: update logo and copyright ([**@ralphtheninja**](https://github.com/ralphtheninja))
- Update `level-packager` to `~0.19.0` ([**@ralphtheninja**](https://github.com/ralphtheninja))
## [0.18.0] - 2013-11-18
### Added
- Add Travis ([**@rvagg**](https://github.com/rvagg))
### Changed
- Update `level-packager` to `~0.18.0` ([**@rvagg**](https://github.com/rvagg))
- Update `leveldown` to `~0.10.0` ([**@rvagg**](https://github.com/rvagg))
## [0.17.0] - 2013-10-01
### Changed
- Update `levelup` to `~0.17.0` ([**@rvagg**](https://github.com/rvagg))
- Update `leveldown` to `~0.9.0` ([**@rvagg**](https://github.com/rvagg))
**Historical Note** 0.17.0 and 0.17.0-1 are listed out of order here, due to 0.17.0-1 not adhering to the semver rules that we follow today.
## [0.17.0-1] - 2013-10-09
### Changed
- Use `level-packager` instead of `levelup` ([**@rvagg**](https://github.com/rvagg))
- Run tests in `level-packager` using `tape` ([**@rvagg**](https://github.com/rvagg))
## [0.16.0] - 2013-09-10
### Added
- Add [**@substack**](https://github.com/substack) to contributors ([**@rvagg**](https://github.com/rvagg))
### Changed
- Update `levelup` to `~0.16.0` ([**@rvagg**](https://github.com/rvagg))
- Update repository and homepage in `package.json` ([**@rvagg**](https://github.com/rvagg))
## [0.15.0] - 2013-08-26
### Changed
- README: tweaks ([**@rvagg**](https://github.com/rvagg))
- Update `levelup` to `~0.15.0` ([**@rvagg**](https://github.com/rvagg))
- Update `leveldown` to `~0.8.0` ([**@rvagg**](https://github.com/rvagg))
## [0.14.0] - 2013-08-19
### Added
- README: add npm downloads badge ([**@rvagg**](https://github.com/rvagg))
### Changed
- Update `levelup` to `~0.14.0` ([**@rvagg**](https://github.com/rvagg))
## [0.13.0] - 2013-08-11
### Changed
- Update `levelup` to `~0.13.0` ([**@rvagg**](https://github.com/rvagg))
- Update `leveldown` to `~0.7.0` ([**@rvagg**](https://github.com/rvagg))
## [0.12.0] - 2013-07-25
### Changed
- Update `levelup` to `~0.12.0` ([**@rvagg**](https://github.com/rvagg))
- Update `leveldown` to `~0.6.2` ([**@rvagg**](https://github.com/rvagg))
## [0.11.0] - 2013-07-17
### Added
- Add [**@pgte**](https://github.com/pgte) to contributors ([**@rvagg**](https://github.com/rvagg))
- README: add npm badge ([**@rvagg**](https://github.com/rvagg))
### Changed
- Update `levelup` to `~0.11.0` ([**@rvagg**](https://github.com/rvagg))
## [0.10.0] - 2013-06-14
### Changed
- Update `levelup` to `~0.10.0` ([**@rvagg**](https://github.com/rvagg))
- Update `leveldown` to `~0.6.0` ([**@rvagg**](https://github.com/rvagg))
## [0.9.0] - 2013-05-27
### Changed
- Update `levelup` to `~0.9.0` ([**@rvagg**](https://github.com/rvagg))
- Update `leveldown` to `~0.5.0` ([**@rvagg**](https://github.com/rvagg))
## 0.8.0 - 2013-05-19
:seedling: Initial release.
[6.0.1]: https://github.com/Level/level/compare/v6.0.0...v6.0.1
[6.0.0]: https://github.com/Level/level/compare/v5.0.1...v6.0.0
[5.0.1]: https://github.com/Level/level/compare/v5.0.0...v5.0.1
[5.0.0]: https://github.com/Level/level/compare/v4.0.0...v5.0.0
[4.0.0]: https://github.com/Level/level/compare/v3.0.2...v4.0.0
[3.0.2]: https://github.com/Level/level/compare/v3.0.1...v3.0.2
[3.0.1]: https://github.com/Level/level/compare/v3.0.0...v3.0.1
[3.0.0]: https://github.com/Level/level/compare/v2.1.2...v3.0.0
[2.1.2]: https://github.com/Level/level/compare/v2.1.1...v2.1.2
[2.1.1]: https://github.com/Level/level/compare/v2.1.0...v2.1.1
[2.1.0]: https://github.com/Level/level/compare/v2.0.1...v2.1.0
[2.0.1]: https://github.com/Level/level/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/Level/level/compare/v2.0.0-rc3...v2.0.0
[2.0.0-rc3]: https://github.com/Level/level/compare/v2.0.0-rc2...v2.0.0-rc3
[2.0.0-rc2]: https://github.com/Level/level/compare/v2.0.0-rc1...v2.0.0-rc2
[2.0.0-rc1]: https://github.com/Level/level/compare/v1.7.0...v2.0.0-rc1
[1.7.0]: https://github.com/Level/level/compare/v1.6.0...v1.7.0
[1.6.0]: https://github.com/Level/level/compare/v1.5.0...v1.6.0
[1.5.0]: https://github.com/Level/level/compare/v1.4.0...v1.5.0
[1.4.0]: https://github.com/Level/level/compare/v1.3.0...v1.4.0
[1.3.0]: https://github.com/Level/level/compare/v1.2.0...v1.3.0
[1.2.0]: https://github.com/Level/level/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/Level/level/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/Level/level/compare/v1.0.0-0...v1.0.0
[1.0.0-0]: https://github.com/Level/level/compare/v0.19.1...v1.0.0-0
[0.19.1]: https://github.com/Level/level/compare/v0.19.0...v0.19.1
[0.19.0]: https://github.com/Level/level/compare/0.18.0...v0.19.0
[0.18.0]: https://github.com/Level/level/compare/0.17.0...0.18.0
[0.17.0]: https://github.com/Level/level/compare/0.17.0-1...0.17.0
[0.17.0-1]: https://github.com/Level/level/compare/0.16.0...0.17.0-1
[0.16.0]: https://github.com/Level/level/compare/0.15.0...0.16.0
[0.15.0]: https://github.com/Level/level/compare/0.14.0...0.15.0
[0.14.0]: https://github.com/Level/level/compare/0.13.0...0.14.0
[0.13.0]: https://github.com/Level/level/compare/0.12.0...0.13.0
[0.12.0]: https://github.com/Level/level/compare/0.11.0...0.12.0
[0.11.0]: https://github.com/Level/level/compare/0.10.0...0.11.0
[0.10.0]: https://github.com/Level/level/compare/0.9.0...0.10.0
[0.9.0]: https://github.com/Level/level/compare/0.8.0...0.9.0

14
node_modules/level/CONTRIBUTORS.md generated vendored Normal file
View File

@@ -0,0 +1,14 @@
# Contributors
| Name | GitHub | Social |
| :------------------------- | :--------------------------------------------------------------- | :------------------------------------------------------------ |
| **Lars-Magnus Skog** | [**@ralphtheninja**](https://github.com/ralphtheninja) | [**@ralph@social.weho.st**](https://social.weho.st/@ralph) |
| **Vincent Weevers** | [**@vweevers**](https://github.com/vweevers) | [**@vweevers@twitter**](https://twitter.com/vweevers) |
| **Rod Vagg** | [**@rvagg**](https://github.com/rvagg) | [**@rvagg@twitter**](https://twitter.com/rvagg) |
| **jess** | [**@monkeywithacupcake**](https://github.com/monkeywithacupcake) | |
| **Julian Gruber** | [**@juliangruber**](https://github.com/juliangruber) | [**@juliangruber@twitter**](https://twitter.com/juliangruber) |
| **Tim Oxley** | [**@timoxley**](https://github.com/timoxley) | [**@secoif@twitter**](https://twitter.com/secoif) |
| **Andrew Kelley** | [**@andrewrk**](https://github.com/andrewrk) | |
| **Joseph Dykstra** | [**@ArtskydJ**](https://github.com/ArtskydJ) | |
| **Matt Walters** | [**@mateodelnorte**](https://github.com/mateodelnorte) | |
| **RasmusErik Voel Jensen** | [**@rasmuserik**](https://github.com/rasmuserik) | |

21
node_modules/level/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,21 @@
# The MIT License (MIT)
**Copyright © 2013-present Rod Vagg and [Contributors](CONTRIBUTORS.md).**
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

528
node_modules/level/README.md generated vendored Normal file
View File

@@ -0,0 +1,528 @@
# level
> Fast & simple storage. A Node.js-style `LevelDB` wrapper for Node.js, Electron and browsers.
[![level badge][level-badge]](https://github.com/Level/awesome)
[![npm](https://img.shields.io/npm/v/level.svg?label=&logo=npm)](https://www.npmjs.com/package/level)
[![Node version](https://img.shields.io/node/v/level.svg)](https://www.npmjs.com/package/level)
[![Travis](https://img.shields.io/travis/com/Level/level.svg?logo=travis&label=)](https://travis-ci.com/Level/level)
[![AppVeyor](https://img.shields.io/appveyor/ci/Level/level.svg?logo=appveyor&label=)](https://ci.appveyor.com/project/Level/level)
[![Coverage Status](https://coveralls.io/repos/github/Level/level/badge.svg)](https://coveralls.io/github/Level/level)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![npm](https://img.shields.io/npm/dm/level.svg?label=dl)](https://www.npmjs.com/package/level)
[![Backers on Open Collective](https://opencollective.com/level/backers/badge.svg?color=orange)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/level/sponsors/badge.svg?color=orange)](#sponsors)
## Table of Contents
<details><summary>Click to expand</summary>
- [Introduction](#introduction)
- [Usage](#usage)
- [Supported Platforms](#supported-platforms)
- [API](#api)
- [Promise Support](#promise-support)
- [Events](#events)
- [Contributing](#contributing)
- [Donate](#donate)
- [License](#license)
</details>
## Introduction
This is a convenience package that:
- exports a function that returns a [`levelup`](https://github.com/Level/levelup#ctor) instance when invoked
- bundles the current release of [`leveldown`][leveldown] and [`level-js`][level-js]
- leverages encodings using [`encoding-down`][encoding-down].
Use this package to avoid having to explicitly install `leveldown` or `level-js` when you just want to use `levelup`. It uses `leveldown` in Node.js or Electron and `level-js` in browsers (when bundled by [`browserify`](https://github.com/browserify/browserify), [`webpack`](https://webpack.js.org/), [`rollup`](https://rollupjs.org/) or similar). For a quick start, visit [`browserify-starter`](https://github.com/Level/browserify-starter) or [`webpack-starter`](https://github.com/Level/webpack-starter). Note: `rollup` currently fails to properly resolve the [`browser`](package.json) field.
## Usage
**If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md).
```js
var level = require('level')
// 1) Create our database, supply location and options.
// This will create or open the underlying store.
var db = level('my-db')
// 2) Put a key & value
db.put('name', 'Level', function (err) {
if (err) return console.log('Ooops!', err) // some kind of I/O error
// 3) Fetch by key
db.get('name', function (err, value) {
if (err) return console.log('Ooops!', err) // likely the key was not found
// Ta da!
console.log('name=' + value)
})
})
```
## Supported Platforms
At the time of writing, `level` works in Node.js 8+ and Electron 3+ on Linux, Mac OS, Windows and FreeBSD, including any future Node.js and Electron release thanks to [N-API](https://nodejs.org/api/n-api.html), including ARM platforms like Raspberry Pi and Android, as well as in Chrome, Firefox, IE 11, Edge, Safari, iPhone and Chrome for Android. For details, see [Supported Platforms](https://github.com/Level/leveldown#supported-platforms) of `leveldown` and [Browser Support](https://github.com/Level/level-js#browser-support) of `level-js`.
Binary values are supported across the board; in browsers that support [IndexedDB Second Edition](https://www.w3.org/TR/IndexedDB-2/) (like Chrome and Firefox) you can also use binary keys.
If you want to use [Promises](#promise-support), you will need a polyfill like [`pinkie`](https://github.com/floatdrop/pinkie) in older browsers like IE.
## API
For options specific to [`leveldown`][leveldown] and [`level-js`][level-js] ("underlying store" from here on out), please see their respective READMEs.
- <a href="#ctor"><code><b>level()</b></code></a>
- <a href="#supports"><code>db.<b>supports</b></code></a>
- <a href="#open"><code>db.<b>open()</b></code></a>
- <a href="#close"><code>db.<b>close()</b></code></a>
- <a href="#put"><code>db.<b>put()</b></code></a>
- <a href="#get"><code>db.<b>get()</b></code></a>
- <a href="#del"><code>db.<b>del()</b></code></a>
- <a href="#batch"><code>db.<b>batch()</b></code></a> _(array form)_
- <a href="#batch_chained"><code>db.<b>batch()</b></code></a> _(chained form)_
- <a href="#isOpen"><code>db.<b>isOpen()</b></code></a>
- <a href="#isClosed"><code>db.<b>isClosed()</b></code></a>
- <a href="#createReadStream"><code>db.<b>createReadStream()</b></code></a>
- <a href="#createKeyStream"><code>db.<b>createKeyStream()</b></code></a>
- <a href="#createValueStream"><code>db.<b>createValueStream()</b></code></a>
- <a href="#iterator"><code>db.<b>iterator()</b></code></a>
- <a href="#clear"><code>db.<b>clear()</b></code></a>
<a name="ctor"></a>
### `db = level(location[, options[, callback]])`
The main entry point for creating a new `levelup` instance.
- `location` is a string pointing to the LevelDB location to be opened or in browsers, the name of the [`IDBDatabase`](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase) to be opened.
- `options` is passed on to the underlying store.
- `options.keyEncoding` and `options.valueEncoding` are passed to [`encoding-down`][encoding-down], default encoding is `'utf8'`
Calling `level('my-db')` will also open the underlying store. This is an asynchronous operation which will trigger your callback if you provide one. The callback should take the form `function (err, db) {}` where `db` is the `levelup` instance. If you don't provide a callback, any read & write operations are simply queued internally until the store is fully opened.
This leads to two alternative ways of managing a `levelup` instance:
```js
level(location, options, function (err, db) {
if (err) throw err
db.get('foo', function (err, value) {
if (err) return console.log('foo does not exist')
console.log('got foo =', value)
})
})
```
Versus the equivalent:
```js
// Will throw if an error occurs
var db = level(location, options)
db.get('foo', function (err, value) {
if (err) return console.log('foo does not exist')
console.log('got foo =', value)
})
```
The constructor function has a `.errors` property which provides access to the different error types from [`level-errors`](https://github.com/Level/errors#api). See example below on how to use it:
```js
level('my-db', { createIfMissing: false }, function (err, db) {
if (err instanceof level.errors.OpenError) {
console.log('failed to open database')
}
})
```
Note that `createIfMissing` is an option specific to [`leveldown`][leveldown].
<a name="supports"></a>
### `db.supports`
A read-only [manifest](https://github.com/Level/supports). Not [widely supported yet](https://github.com/Level/community/issues/83). Might be used like so:
```js
if (!db.supports.permanence) {
throw new Error('Persistent storage is required')
}
if (db.supports.bufferKeys && db.supports.promises) {
await db.put(Buffer.from('key'), 'value')
}
```
<a name="open"></a>
### `db.open([callback])`
Opens the underlying store. In general you should never need to call this method directly as it's automatically called by <a href="#ctor"><code>levelup()</code></a>.
However, it is possible to _reopen_ the store after it has been closed with <a href="#close"><code>close()</code></a>, although this is not generally advised.
If no callback is passed, a promise is returned.
<a name="close"></a>
### `db.close([callback])`
<code>close()</code> closes the underlying store. The callback will receive any error encountered during closing as the first argument.
You should always clean up your `levelup` instance by calling `close()` when you no longer need it to free up resources. A store cannot be opened by multiple instances of `levelup` simultaneously.
If no callback is passed, a promise is returned.
<a name="put"></a>
### `db.put(key, value[, options][, callback])`
<code>put()</code> is the primary method for inserting data into the store. Both `key` and `value` can be of any type as far as `levelup` is concerned.
- `options` is passed on to the underlying store
- `options.keyEncoding` and `options.valueEncoding` are passed to [`encoding-down`][encoding-down], allowing you to override the key- and/or value encoding for this `put` operation.
If no callback is passed, a promise is returned.
<a name="get"></a>
### `db.get(key[, options][, callback])`
<code>get()</code> is the primary method for fetching data from the store. The `key` can be of any type. If it doesn't exist in the store then the callback or promise will receive an error. A not-found err object will be of type `'NotFoundError'` so you can `err.type == 'NotFoundError'` or you can perform a truthy test on the property `err.notFound`.
```js
db.get('foo', function (err, value) {
if (err) {
if (err.notFound) {
// handle a 'NotFoundError' here
return
}
// I/O or other error, pass it up the callback chain
return callback(err)
}
// .. handle `value` here
})
```
- `options` is passed on to the underlying store.
- `options.keyEncoding` and `options.valueEncoding` are passed to [`encoding-down`][encoding-down], allowing you to override the key- and/or value encoding for this `get` operation.
If no callback is passed, a promise is returned.
<a name="del"></a>
### `db.del(key[, options][, callback])`
<code>del()</code> is the primary method for removing data from the store.
```js
db.del('foo', function (err) {
if (err)
// handle I/O or other error
});
```
- `options` is passed on to the underlying store.
- `options.keyEncoding` is passed to [`encoding-down`][encoding-down], allowing you to override the key encoding for this `del` operation.
If no callback is passed, a promise is returned.
<a name="batch"></a>
### `db.batch(array[, options][, callback])` _(array form)_
<code>batch()</code> can be used for very fast bulk-write operations (both _put_ and _delete_). The `array` argument should contain a list of operations to be executed sequentially, although as a whole they are performed as an atomic operation inside the underlying store.
Each operation is contained in an object having the following properties: `type`, `key`, `value`, where the _type_ is either `'put'` or `'del'`. In the case of `'del'` the `value` property is ignored. Any entries with a `key` of `null` or `undefined` will cause an error to be returned on the `callback` and any `type: 'put'` entry with a `value` of `null` or `undefined` will return an error.
```js
var ops = [
{ type: 'del', key: 'father' },
{ type: 'put', key: 'name', value: 'Yuri Irsenovich Kim' },
{ type: 'put', key: 'dob', value: '16 February 1941' },
{ type: 'put', key: 'spouse', value: 'Kim Young-sook' },
{ type: 'put', key: 'occupation', value: 'Clown' }
]
db.batch(ops, function (err) {
if (err) return console.log('Ooops!', err)
console.log('Great success dear leader!')
})
```
- `options` is passed on to the underlying store.
- `options.keyEncoding` and `options.valueEncoding` are passed to [`encoding-down`][encoding-down], allowing you to override the key- and/or value encoding of operations in this batch.
If no callback is passed, a promise is returned.
<a name="batch_chained"></a>
### `db.batch()` _(chained form)_
<code>batch()</code>, when called with no arguments will return a `Batch` object which can be used to build, and eventually commit, an atomic batch operation. Depending on how it's used, it is possible to obtain greater performance when using the chained form of `batch()` over the array form.
```js
db.batch()
.del('father')
.put('name', 'Yuri Irsenovich Kim')
.put('dob', '16 February 1941')
.put('spouse', 'Kim Young-sook')
.put('occupation', 'Clown')
.write(function () { console.log('Done!') })
```
**`batch.put(key, value)`**
Queue a _put_ operation on the current batch, not committed until a `write()` is called on the batch.
This method may `throw` a `WriteError` if there is a problem with your put (such as the `value` being `null` or `undefined`).
**`batch.del(key)`**
Queue a _del_ operation on the current batch, not committed until a `write()` is called on the batch.
This method may `throw` a `WriteError` if there is a problem with your delete.
**`batch.clear()`**
Clear all queued operations on the current batch, any previous operations will be discarded.
**`batch.length`**
The number of queued operations on the current batch.
**`batch.write([options][, callback])`**
Commit the queued operations for this batch. All operations not _cleared_ will be written to the underlying store atomically, that is, they will either all succeed or fail with no partial commits.
- `options` is passed on to the underlying store.
- `options.keyEncoding` and `options.valueEncoding` are not supported here.
If no callback is passed, a promise is returned.
<a name="isOpen"></a>
### `db.isOpen()`
A `levelup` instance can be in one of the following states:
- _"new"_ - newly created, not opened or closed
- _"opening"_ - waiting for the underlying store to be opened
- _"open"_ - successfully opened the store, available for use
- _"closing"_ - waiting for the store to be closed
- _"closed"_ - store has been successfully closed, should not be used
`isOpen()` will return `true` only when the state is "open".
<a name="isClosed"></a>
### `db.isClosed()`
`isClosed()` will return `true` only when the state is "closing" _or_ "closed", it can be useful for determining if read and write operations are permissible.
<a name="createReadStream"></a>
### `db.createReadStream([options])`
Returns a [Readable Stream](https://nodejs.org/docs/latest/api/stream.html#stream_readable_streams) of key-value pairs. A pair is an object with `key` and `value` properties. By default it will stream all entries in the underlying store from start to end. Use the options described below to control the range, direction and results.
```js
db.createReadStream()
.on('data', function (data) {
console.log(data.key, '=', data.value)
})
.on('error', function (err) {
console.log('Oh my!', err)
})
.on('close', function () {
console.log('Stream closed')
})
.on('end', function () {
console.log('Stream ended')
})
```
You can supply an options object as the first parameter to `createReadStream()` with the following properties:
- `gt` (greater than), `gte` (greater than or equal) define the lower bound of the range to be streamed. Only entries where the key is greater than (or equal to) this option will be included in the range. When `reverse=true` the order will be reversed, but the entries streamed will be the same.
- `lt` (less than), `lte` (less than or equal) define the higher bound of the range to be streamed. Only entries where the key is less than (or equal to) this option will be included in the range. When `reverse=true` the order will be reversed, but the entries streamed will be the same.
- `reverse` _(boolean, default: `false`)_: stream entries in reverse order. Beware that due to the way that stores like LevelDB work, a reverse seek can be slower than a forward seek.
- `limit` _(number, default: `-1`)_: limit the number of entries collected by this stream. This number represents a _maximum_ number of entries and may not be reached if you get to the end of the range first. A value of `-1` means there is no limit. When `reverse=true` the entries with the highest keys will be returned instead of the lowest keys.
- `keys` _(boolean, default: `true`)_: whether the results should contain keys. If set to `true` and `values` set to `false` then results will simply be keys, rather than objects with a `key` property. Used internally by the `createKeyStream()` method.
- `values` _(boolean, default: `true`)_: whether the results should contain values. If set to `true` and `keys` set to `false` then results will simply be values, rather than objects with a `value` property. Used internally by the `createValueStream()` method.
Legacy options:
- `start`: instead use `gte`
- `end`: instead use `lte`
Underlying stores may have additional options.
<a name="createKeyStream"></a>
### `db.createKeyStream([options])`
Returns a [Readable Stream](https://nodejs.org/docs/latest/api/stream.html#stream_readable_streams) of keys rather than key-value pairs. Use the same options as described for <a href="#createReadStream"><code>createReadStream</code></a> to control the range and direction.
You can also obtain this stream by passing an options object to `createReadStream()` with `keys` set to `true` and `values` set to `false`. The result is equivalent; both streams operate in [object mode](https://nodejs.org/docs/latest/api/stream.html#stream_object_mode).
```js
db.createKeyStream()
.on('data', function (data) {
console.log('key=', data)
})
// same as:
db.createReadStream({ keys: true, values: false })
.on('data', function (data) {
console.log('key=', data)
})
```
<a name="createValueStream"></a>
### `db.createValueStream([options])`
Returns a [Readable Stream](https://nodejs.org/docs/latest/api/stream.html#stream_readable_streams) of values rather than key-value pairs. Use the same options as described for <a href="#createReadStream"><code>createReadStream</code></a> to control the range and direction.
You can also obtain this stream by passing an options object to `createReadStream()` with `values` set to `true` and `keys` set to `false`. The result is equivalent; both streams operate in [object mode](https://nodejs.org/docs/latest/api/stream.html#stream_object_mode).
```js
db.createValueStream()
.on('data', function (data) {
console.log('value=', data)
})
// same as:
db.createReadStream({ keys: false, values: true })
.on('data', function (data) {
console.log('value=', data)
})
```
<a name="iterator"></a>
### `db.iterator([options])`
Returns an [`abstract-leveldown` iterator](https://github.com/Level/abstract-leveldown/#iterator), which is what powers the readable streams above. Options are the same as the range options of <a href="#createReadStream"><code>createReadStream</code></a> and are passed to the underlying store.
<a name="clear"></a>
### `db.clear([options][, callback])`
**This method is experimental. Not all underlying stores support it yet. Consult [Level/community#79](https://github.com/Level/community/issues/79) to find out if your (combination of) dependencies support `db.clear()`.**
Delete all entries or a range. Not guaranteed to be atomic. Accepts the following range options (with the same rules as on iterators):
- `gt` (greater than), `gte` (greater than or equal) define the lower bound of the range to be deleted. Only entries where the key is greater than (or equal to) this option will be included in the range. When `reverse=true` the order will be reversed, but the entries deleted will be the same.
- `lt` (less than), `lte` (less than or equal) define the higher bound of the range to be deleted. Only entries where the key is less than (or equal to) this option will be included in the range. When `reverse=true` the order will be reversed, but the entries deleted will be the same.
- `reverse` _(boolean, default: `false`)_: delete entries in reverse order. Only effective in combination with `limit`, to remove the last N records.
- `limit` _(number, default: `-1`)_: limit the number of entries to be deleted. This number represents a _maximum_ number of entries and may not be reached if you get to the end of the range first. A value of `-1` means there is no limit. When `reverse=true` the entries with the highest keys will be deleted instead of the lowest keys.
If no options are provided, all entries will be deleted. The `callback` function will be called with no arguments if the operation was successful or with an `WriteError` if it failed for any reason.
If no callback is passed, a promise is returned.
## Promise Support
`level(up)` ships with native `Promise` support out of the box.
Each function taking a callback also can be used as a promise, if the callback is omitted. This applies for:
- `db.get(key[, options])`
- `db.put(key, value[, options])`
- `db.del(key[, options])`
- `db.batch(ops[, options])`
- `db.batch().write()`
- `db.clear(options)`
The only exception is the `level` constructor itself, which if no callback is passed will lazily open the underlying store in the background.
Example:
```js
var db = level('my-db')
db.put('foo', 'bar')
.then(function () { return db.get('foo') })
.then(function (value) { console.log(value) })
.catch(function (err) { console.error(err) })
```
Or using `async/await`:
```js
var main = async () => {
var db = level('my-db')
await db.put('foo', 'bar')
console.log(await db.get('foo'))
}
```
## Events
`levelup` is an [`EventEmitter`](https://nodejs.org/api/events.html) and emits the following events.
| Event | Description | Arguments |
| :-------- | :-------------------------- | :------------------- |
| `put` | Key has been updated | `key, value` (any) |
| `del` | Key has been deleted | `key` (any) |
| `batch` | Batch has executed | `operations` (array) |
| `opening` | Underlying store is opening | - |
| `open` | Store has opened | - |
| `ready` | Alias of `open` | - |
| `closing` | Store is closing | - |
| `closed` | Store has closed. | - |
For example you can do:
```js
db.on('put', function (key, value) {
console.log('inserted', { key, value })
})
```
## Contributing
[`Level/level`](https://github.com/Level/level) is an **OPEN Open Source Project**. This means that:
> Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
See the [Contribution Guide](https://github.com/Level/community/blob/master/CONTRIBUTING.md) for more details.
## Donate
To sustain [`Level`](https://github.com/Level) and its activities, become a backer or sponsor on [Open Collective](https://opencollective.com/level). Your logo or avatar will be displayed on our 28+ [GitHub repositories](https://github.com/Level) and [npm](https://www.npmjs.com/) packages. 💖
### Backers
[![Open Collective backers](https://opencollective.com/level/backers.svg?width=890)](https://opencollective.com/level)
### Sponsors
[![Open Collective sponsors](https://opencollective.com/level/sponsors.svg?width=890)](https://opencollective.com/level)
## License
[MIT](LICENSE.md) © 2013-present Rod Vagg and [Contributors](CONTRIBUTORS.md).
[level-badge]: https://leveljs.org/img/badge.svg
[leveldown]: https://github.com/Level/leveldown
[level-js]: https://github.com/Level/level-js
[encoding-down]: https://github.com/Level/encoding-down

76
node_modules/level/UPGRADING.md generated vendored Normal file
View File

@@ -0,0 +1,76 @@
# Upgrade Guide
This document describes breaking changes and how to upgrade. For a complete list of changes including minor and patch releases, please refer to the [changelog](CHANGELOG.md).
## 6.0.0
**No breaking changes to the `level` API. If you're only using `level` in Node.js or Electron, you can upgrade without thinking twice.**
The major bump is for browsers, because `level` upgraded to [`level-js@5`](https://github.com/Level/level-js):
> Support of keys & values other than strings and Buffers has been dropped. Internally `level-js` now stores keys & values as binary which solves a number of compatibility issues ([Level/memdown#186](https://github.com/Level/memdown/issues/186)). If you pass in a key or value that isn't a string or Buffer, it will be irreversibly stringified.
>
> Existing IndexedDB databases created with `level-js@4` \[via `level@5`] can be read only if they used binary keys and string or binary values. Other types will come out stringified, and string keys will sort incorrectly. Use the included `upgrade()` utility to convert stored data to binary (in so far the environment supports it):
>
> ```js
> var level = require('level')
> var reachdown = require('reachdown')
> var db = level('my-db')
>
> db.open(function (err) {
> if (err) throw err
>
> reachdown(db, 'level-js').upgrade(function (err) {
> if (err) throw err
> })
> })
> ```
### New Features :sparkles:
In case you missed it (a few of these already floated into `level@5`) some exciting new features are now available in all environments:
- Added [`db.clear()`](https://github.com/Level/level#dbclearoptions-callback) to delete all entries or a range! Also works in [`subleveldown`](https://github.com/Level/subleveldown) - empty that bucket!
- Check out [`db.supports`](https://github.com/Level/level#supports): a manifest describing the features of a db!
- Glorious: `leveldown` ships a prebuilt binary for Linux that is now [compatible with Debian 8, Ubuntu 14.04, RHEL 7, CentOS 7 and other flavors with an old glibc](https://github.com/Level/leveldown/pull/674)!
- With thanks to [Cirrus CI](https://cirrus-ci.org/), `leveldown` is now [continuously tested in FreeBSD](https://github.com/Level/leveldown/pull/678)!
Go forth and build amazing things.
## 5.0.0
Upgraded to [`leveldown@5.0.0`](https://github.com/Level/leveldown/blob/v5.0.0/UPGRADING.md#v5) and (through `level-packager@5`) [`levelup@4`](https://github.com/Level/levelup/blob/v4.0.0/UPGRADING.md#v4) and [`encoding-down@6`](https://github.com/Level/encoding-down/blob/v6.0.0/UPGRADING.md#v6). Please follow these links for more information. A quick summary: range options (e.g. `gt`) are now serialized the same as keys, `{ gt: undefined }` is not the same as `{}`, nullish values are now rejected and streams are backed by [`readable-stream@3`](https://github.com/nodejs/readable-stream#version-3xx).
In addition, `level` got browser support! It uses [`leveldown`](https://github.com/Level/leveldown) in node and [`level-js`](https://github.com/Level/level-js) in browsers (backed by [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API)). As such, [`level-browserify`](https://github.com/Level/level-browserify) is not needed anymore and will be deprecated later on. To learn what the integration of `level-js` means for platform, browser and type support, please see the updated [README](README.md#supported-platforms).
## 4.0.0
Dropped support for node 4. No other breaking changes.
## 3.0.0
No breaking changes to the `level` API.
This is an upgrade to `leveldown@^3.0.0` which is based on `abstract-leveldown@~4.0.0` which in turn contains breaking changes to [`.batch()`](https://github.com/Level/abstract-leveldown/commit/a2621ad70571f6ade9d2be42632ece042e068805). Though this is negated by `levelup`, we decided to release a new major version in the event of dependents reaching down into `db.db`.
## 2.0.0
No breaking changes to the `level` API.
The parts that make up `level` have been refactored to increase modularity. This is an upgrade to `leveldown@~2.0.0` and `level-packager@~2.0.0`, which in turn upgraded to `levelup@^2.0.0`. The responsibility of encoding keys and values moved from [`levelup`](https://github.com/Level/levelup) to [`encoding-down`](https://github.com/Level/encoding-down), which comes bundled with [`level-packager`](https://github.com/Level/packager).
Being a convenience package, `level` glues the parts back together to form a drop-in replacement for the users of `levelup@1`, while staying fully compatible with `level@1`. One thing we do get for free, is native Promise support.
```js
const db = level('db')
await db.put('foo', 'bar')
console.log(await db.get('foo'))
```
This does not affect the existing callback API, functionality-wise or performance-wise.
For more information please check the corresponding `CHANGELOG.md` for:
- [`levelup`](https://github.com/Level/levelup/blob/master/CHANGELOG.md)
- [`leveldown`](https://github.com/Level/leveldown/blob/master/CHANGELOG.md)
- [`level-packager`](https://github.com/Level/packager/blob/master/CHANGELOG.md)

1
node_modules/level/browser.js generated vendored Normal file
View File

@@ -0,0 +1 @@
module.exports = require('level-packager')(require('level-js'))

1
node_modules/level/level.js generated vendored Normal file
View File

@@ -0,0 +1 @@
module.exports = require('level-packager')(require('leveldown'))

59
node_modules/level/package.json generated vendored Normal file
View File

@@ -0,0 +1,59 @@
{
"name": "level",
"version": "6.0.1",
"description": "Fast & simple storage - a Node.js-style LevelDB wrapper (a convenience package bundling LevelUP & LevelDOWN)",
"license": "MIT",
"main": "level.js",
"scripts": {
"test": "standard && nyc node test.js && verify-travis-appveyor",
"test-browser-local": "airtap --local test-browser.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"hallmark": "hallmark --fix",
"dependency-check": "dependency-check . browser.js test*.js",
"prepublishOnly": "npm run dependency-check"
},
"browser": "browser.js",
"dependencies": {
"level-js": "^5.0.0",
"level-packager": "^5.1.0",
"leveldown": "^5.4.0"
},
"devDependencies": {
"airtap": "^3.0.0",
"coveralls": "^3.0.2",
"dependency-check": "^3.3.0",
"hallmark": "^2.0.0",
"level-community": "^3.0.0",
"nyc": "^15.0.0",
"pinkie": "^2.0.4",
"standard": "^14.0.0",
"tape": "^4.2.2",
"uuid": "^3.3.2",
"verify-travis-appveyor": "^3.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/level"
},
"hallmark": {
"community": "level-community"
},
"repository": {
"type": "git",
"url": "https://github.com/Level/level.git"
},
"homepage": "https://github.com/Level/level",
"keywords": [
"level",
"leveldb",
"stream",
"database",
"db",
"store",
"storage",
"json"
],
"engines": {
"node": ">=8.6.0"
}
}

81
node_modules/level/test-browser.js generated vendored Normal file
View File

@@ -0,0 +1,81 @@
'use strict'
// Promise polyfill for IE and others.
if (typeof Promise !== 'function') {
global.Promise = require('pinkie')
}
var test = require('tape')
var uuid = require('uuid/v4')
var level = require('.')
require('level-packager/abstract/base-test')(test, level)
require('level-packager/abstract/db-values-test')(test, level)
function factory (opts) {
return level(uuid(), opts)
}
test('level put', function (t) {
t.plan(4)
var db = factory()
db.put('name', 'level', function (err) {
t.ifError(err, 'no put error')
db.get('name', function (err, value) {
t.ifError(err, 'no get error')
t.is(value, 'level')
db.close(function (err) {
t.ifError(err, 'no close error')
})
})
})
})
test('level Buffer value', function (t) {
t.plan(5)
var db = factory({ valueEncoding: 'binary' })
var buf = Buffer.from('00ff', 'hex')
db.put('binary', buf, function (err) {
t.ifError(err, 'no put error')
db.get('binary', function (err, value) {
t.ifError(err, 'no get error')
t.ok(Buffer.isBuffer(value), 'is a buffer')
t.same(value, buf)
db.close(function (err) {
t.ifError(err, 'no close error')
})
})
})
})
test('level Buffer key', function (t) {
var db = factory({ keyEncoding: 'binary' })
var key = Buffer.from('00ff', 'hex')
if (!db.supports.bufferKeys) {
t.pass('Environment does not support buffer keys')
return t.end()
}
db.put(key, 'value', function (err) {
t.ifError(err, 'no put error')
db.get(key, function (err, value) {
t.ifError(err, 'no get error')
t.is(value, 'value')
db.close(function (err) {
t.ifError(err, 'no close error')
t.end()
})
})
})
})

1
node_modules/level/test.js generated vendored Normal file
View File

@@ -0,0 +1 @@
require('level-packager/abstract/test')(require('tape'), require('./'))