fix: Resolve TypeScript errors
Signed-off-by: Hermes Agent <hermes@nosuchhost>
This commit is contained in:
10
client/node_modules/level-concat-iterator/.travis.yml
generated
vendored
Normal file
10
client/node_modules/level-concat-iterator/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
sudo: false
|
||||
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- 6
|
||||
- 8
|
||||
- 10
|
||||
|
||||
after_success: npm run coverage
|
||||
45
client/node_modules/level-concat-iterator/CHANGELOG.md
generated
vendored
Normal file
45
client/node_modules/level-concat-iterator/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
# Changelog
|
||||
|
||||
## [Unreleased][unreleased]
|
||||
|
||||
## [2.0.1] - 2019-04-01
|
||||
|
||||
### Changed
|
||||
|
||||
- Upgrade `standard` devDependency from `^11.0.1` to `^12.0.1` ([`6b957cf`](https://github.com/Level/concat-iterator/commit/6b957cf)) ([**@vweevers**](https://github.com/vweevers))
|
||||
- Apply common project tweaks ([#12](https://github.com/Level/concat-iterator/issues/12), [#13](https://github.com/Level/concat-iterator/issues/13), [`0c1d4e0`](https://github.com/Level/concat-iterator/commit/0c1d4e0)) ([**@vweevers**](https://github.com/vweevers))
|
||||
|
||||
### Added
|
||||
|
||||
- Add `nyc` and `coveralls` ([#11](https://github.com/Level/concat-iterator/issues/11), [`a3e312a`](https://github.com/Level/concat-iterator/commit/a3e312a)) ([**@ralphtheninja**](https://github.com/ralphtheninja), [**@vweevers**](https://github.com/vweevers))
|
||||
|
||||
### Removed
|
||||
|
||||
- Remove node 9 from travis ([`0347b82`](https://github.com/Level/concat-iterator/commit/0347b82)) ([**@ralphtheninja**](https://github.com/ralphtheninja))
|
||||
|
||||
## [2.0.0] - 2018-06-27
|
||||
|
||||
### Changed
|
||||
|
||||
- Detect end by checking key and value ([**@vweevers**](https://github.com/vweevers))
|
||||
- Use `level` in example instead of `leveldown` ([**@ralphtheninja**](https://github.com/ralphtheninja))
|
||||
- End iterator if next errors ([**@ralphtheninja**](https://github.com/ralphtheninja))
|
||||
|
||||
### Removed
|
||||
|
||||
- Remove custom `nextTick` parameter ([**@ralphtheninja**](https://github.com/ralphtheninja))
|
||||
|
||||
### Added
|
||||
|
||||
- Add `homepage` and `repository` to `package.json` ([**@ralphtheninja**](https://github.com/ralphtheninja))
|
||||
- Add `UPGRADING.md` ([**@ralphtheninja**](https://github.com/ralphtheninja))
|
||||
|
||||
## 1.0.0 - 2018-06-24
|
||||
|
||||
:seedling: Initial release.
|
||||
|
||||
[unreleased]: https://github.com/Level/concat-iterator/compare/v2.0.1...HEAD
|
||||
|
||||
[2.0.1]: https://github.com/Level/concat-iterator/compare/v2.0.0...v2.0.1
|
||||
|
||||
[2.0.0]: https://github.com/Level/concat-iterator/compare/v1.0.0...v2.0.0
|
||||
6
client/node_modules/level-concat-iterator/CONTRIBUTORS.md
generated
vendored
Normal file
6
client/node_modules/level-concat-iterator/CONTRIBUTORS.md
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# 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) |
|
||||
21
client/node_modules/level-concat-iterator/LICENSE.md
generated
vendored
Normal file
21
client/node_modules/level-concat-iterator/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# The MIT License (MIT)
|
||||
|
||||
**Copyright © 2018-present [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.
|
||||
62
client/node_modules/level-concat-iterator/README.md
generated
vendored
Normal file
62
client/node_modules/level-concat-iterator/README.md
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
# level-concat-iterator
|
||||
|
||||
> Concatenate items from an iterator into an array.
|
||||
|
||||
[![level badge][level-badge]](https://github.com/Level/awesome)
|
||||
[](https://www.npmjs.com/package/level-concat-iterator)
|
||||
[](https://www.npmjs.com/package/level-concat-iterator)
|
||||
[](https://travis-ci.org/Level/concat-iterator)
|
||||
[](https://coveralls.io/github/Level/concat-iterator)
|
||||
[](https://standardjs.com)
|
||||
[](https://www.npmjs.com/package/level-concat-iterator)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var concat = require('level-concat-iterator')
|
||||
var level = require('level')
|
||||
|
||||
level('DB', function (err, db) {
|
||||
db.put('foo', 'bar', function (err) {
|
||||
concat(db.iterator(), function (err, data) {
|
||||
console.log(data)
|
||||
})
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
**If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md).
|
||||
|
||||
## API
|
||||
|
||||
### `concat(iterator, cb)`
|
||||
|
||||
Takes an `abstract-leveldown` compatible `iterator` as first parameter and calls back with an array of keys and values. Calls back with an error if `iterator.next(cb)` or `iterator.end(cb)` errors.
|
||||
|
||||
## Contributing
|
||||
|
||||
[`Level/concat-iterator`](https://github.com/Level/concat-iterator) 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), [npm](https://www.npmjs.com/) packages and (soon) [our website](http://leveldb.org). 💖
|
||||
|
||||
### Backers
|
||||
|
||||
[](https://opencollective.com/level)
|
||||
|
||||
### Sponsors
|
||||
|
||||
[](https://opencollective.com/level)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE.md) © 2018-present [Contributors](CONTRIBUTORS.md).
|
||||
|
||||
[level-badge]: http://leveldb.org/img/badge.svg
|
||||
7
client/node_modules/level-concat-iterator/UPGRADING.md
generated
vendored
Normal file
7
client/node_modules/level-concat-iterator/UPGRADING.md
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# 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).
|
||||
|
||||
## v2
|
||||
|
||||
The `nextTick` parameter was removed.
|
||||
13
client/node_modules/level-concat-iterator/example.js
generated
vendored
Normal file
13
client/node_modules/level-concat-iterator/example.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
var level = require('level')
|
||||
var concat = require('.')
|
||||
|
||||
level('DB', function (err, db) {
|
||||
if (err) throw err
|
||||
db.put('foo', 'bar', function (err) {
|
||||
if (err) throw err
|
||||
concat(db.iterator(), function (err, data) {
|
||||
if (err) throw err
|
||||
console.log(data)
|
||||
})
|
||||
})
|
||||
})
|
||||
15
client/node_modules/level-concat-iterator/index.js
generated
vendored
Normal file
15
client/node_modules/level-concat-iterator/index.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
module.exports = function (iterator, cb) {
|
||||
var data = []
|
||||
var next = function () {
|
||||
iterator.next(function (err, key, value) {
|
||||
if (err || (key === undefined && value === undefined)) {
|
||||
return iterator.end(function (err2) {
|
||||
cb(err || err2, data)
|
||||
})
|
||||
}
|
||||
data.push({ key: key, value: value })
|
||||
next()
|
||||
})
|
||||
}
|
||||
next()
|
||||
}
|
||||
41
client/node_modules/level-concat-iterator/package.json
generated
vendored
Normal file
41
client/node_modules/level-concat-iterator/package.json
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "level-concat-iterator",
|
||||
"version": "2.0.1",
|
||||
"description": "Concatenate items from an iterator into an array.",
|
||||
"author": "Lars-Magnus Skog <ralphtheninja@riseup.net>",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "standard && hallmark && nyc node test",
|
||||
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
||||
"hallmark": "hallmark --fix",
|
||||
"dependency-check": "dependency-check . test.js",
|
||||
"prepublishOnly": "npm run dependency-check"
|
||||
},
|
||||
"devDependencies": {
|
||||
"coveralls": "^3.0.2",
|
||||
"dependency-check": "^3.3.0",
|
||||
"hallmark": "^0.1.0",
|
||||
"level-community": "^3.0.0",
|
||||
"nyc": "^13.3.0",
|
||||
"standard": "^12.0.1",
|
||||
"tape": "^4.9.1"
|
||||
},
|
||||
"hallmark": {
|
||||
"community": "level-community"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Level/concat-iterator.git"
|
||||
},
|
||||
"homepage": "https://github.com/Level/concat-iterator",
|
||||
"keywords": [
|
||||
"level",
|
||||
"concatenate",
|
||||
"iterator",
|
||||
"array"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
}
|
||||
114
client/node_modules/level-concat-iterator/test.js
generated
vendored
Normal file
114
client/node_modules/level-concat-iterator/test.js
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
var test = require('tape')
|
||||
var collect = require('.')
|
||||
|
||||
test('calls back with error if iterator.next errors', function (t) {
|
||||
t.plan(3)
|
||||
|
||||
var iterator = {
|
||||
next: function (cb) {
|
||||
t.pass('iterator.next called')
|
||||
process.nextTick(cb, new Error('iterator.next'))
|
||||
},
|
||||
end: function (cb) {
|
||||
t.pass('iterator.end called')
|
||||
process.nextTick(cb)
|
||||
}
|
||||
}
|
||||
|
||||
collect(iterator, function (err) {
|
||||
t.is(err.message, 'iterator.next', 'correct error')
|
||||
})
|
||||
})
|
||||
|
||||
test('happy path calls back with an array', function (t) {
|
||||
t.plan(6)
|
||||
|
||||
var i = 0
|
||||
var data = [
|
||||
{ key: 'key1', value: 'value1' },
|
||||
{ key: 'key2', value: 'value2' }
|
||||
]
|
||||
|
||||
var iterator = {
|
||||
next: function (cb) {
|
||||
t.pass('iterator.next called')
|
||||
if (i < data.length) {
|
||||
process.nextTick(cb, null, data[i].key, data[i].value)
|
||||
++i
|
||||
} else {
|
||||
process.nextTick(cb)
|
||||
}
|
||||
},
|
||||
end: function (cb) {
|
||||
t.pass('iterator.end called')
|
||||
process.nextTick(cb)
|
||||
}
|
||||
}
|
||||
|
||||
collect(iterator, function (err, result) {
|
||||
t.error(err, 'no error')
|
||||
t.same(result, data)
|
||||
})
|
||||
})
|
||||
|
||||
test('calls back with error and data if iterator.end errors', function (t) {
|
||||
t.plan(6)
|
||||
|
||||
var i = 0
|
||||
var data = [
|
||||
{ key: 'key1', value: 'value1' },
|
||||
{ key: 'key2', value: 'value2' }
|
||||
]
|
||||
|
||||
var iterator = {
|
||||
next: function (cb) {
|
||||
t.pass('iterator.next called')
|
||||
if (i < data.length) {
|
||||
process.nextTick(cb, null, data[i].key, data[i].value)
|
||||
++i
|
||||
} else {
|
||||
process.nextTick(cb)
|
||||
}
|
||||
},
|
||||
end: function (cb) {
|
||||
t.pass('iterator.end called')
|
||||
process.nextTick(cb, new Error('iterator.end'))
|
||||
}
|
||||
}
|
||||
|
||||
collect(iterator, function (err, result) {
|
||||
t.is(err.message, 'iterator.end', 'correct error')
|
||||
t.same(result, data)
|
||||
})
|
||||
})
|
||||
|
||||
test('calls back with error and partial data if iterator.end errors', function (t) {
|
||||
t.plan(5)
|
||||
|
||||
var i = 0
|
||||
var data = [
|
||||
{ key: 'key1', value: 'value1' },
|
||||
{ key: 'key2', value: 'value2' }
|
||||
]
|
||||
|
||||
var iterator = {
|
||||
next: function (cb) {
|
||||
t.pass('iterator.next called')
|
||||
if (i === 0) {
|
||||
process.nextTick(cb, null, data[i].key, data[i].value)
|
||||
i++
|
||||
} else {
|
||||
process.nextTick(cb)
|
||||
}
|
||||
},
|
||||
end: function (cb) {
|
||||
t.pass('iterator.end called')
|
||||
process.nextTick(cb, new Error('foo'))
|
||||
}
|
||||
}
|
||||
|
||||
collect(iterator, function (err, result) {
|
||||
t.is(err.message, 'foo', 'correct error')
|
||||
t.same(result, [].concat(data[0]))
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user