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

1296
node_modules/levelup/CHANGELOG.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

49
node_modules/levelup/CONTRIBUTORS.md generated vendored Normal file
View File

@@ -0,0 +1,49 @@
# Contributors
| Name | GitHub | Social |
| :------------------------- | :------------------------------------------------------------------------- | :------------------------------------------------------------------ |
| **Rod Vagg** | [**@rvagg**](https://github.com/rvagg) | [**@rvagg@twitter**](https://twitter.com/rvagg) |
| **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) |
| **Julian Gruber** | [**@juliangruber**](https://github.com/juliangruber) | [**@juliangruber@twitter**](https://twitter.com/juliangruber) |
| **Dominic Tarr** | [**@dominictarr**](https://github.com/dominictarr) | [**@dominictarr@twitter**](https://twitter.com/dominictarr) |
| **Matteo Collina** | [**@mcollina**](https://github.com/mcollina) | [**@matteocollina@twitter**](https://twitter.com/matteocollina) |
| **James Halliday** | [**@substack**](https://github.com/substack) | [**@substack@twitter**](https://twitter.com/substack) |
| **David Björklund** | [**@kesla**](https://github.com/kesla) | [**@david_bjorklund@twitter**](https://twitter.com/david_bjorklund) |
| **Meirion Hughes** | [**@MeirionHughes**](https://github.com/MeirionHughes) | |
| **Raynos (Jake Verbaten)** | | |
| **Jarrett Cruger** | [**@jcrugzz**](https://github.com/jcrugzz) | [**@jcrugzz@twitter**](https://twitter.com/jcrugzz) |
| **Arnout Engelen** | [**@raboof**](https://github.com/raboof) | |
| **Ben West** | [**@bewest**](https://github.com/bewest) | |
| **Huan LI** | [**@zixia**](https://github.com/zixia) | [**@zixia@twitter**](https://twitter.com/zixia) |
| **Kyle E. Mitchell** | | |
| **Aditya Purwa** | [**@adityapurwa**](https://github.com/adityapurwa) | |
| **Eduardo Sorribas** | [**@sorribas**](https://github.com/sorribas) | |
| **James Butler** | [**@sandfox**](https://github.com/sandfox) | |
| **Nolan Lawson** | [**@nolanlawson**](https://github.com/nolanlawson) | [**@nolan@toot.cafe**](https://toot.cafe/@nolan) |
| **Alejandro Oviedo** | [**@a0viedo**](https://github.com/a0viedo) | |
| **Alex Potsides** | | |
| **Andrew Kelley** | [**@andrewrk**](https://github.com/andrewrk) | |
| **Braydon Fuller** | [**@braydonf**](https://github.com/braydonf) | |
| **Brian Woodward** | [**@doowb**](https://github.com/doowb) | [**@doowb@twitter**](https://twitter.com/doowb) |
| **Calvin Metcalf** | [**@calvinmetcalf**](https://github.com/calvinmetcalf) | |
| **Daniel Ravina** | [**@danielravina**](https://github.com/danielravina) | |
| **David Dias** | [**@diasdavid**](https://github.com/diasdavid) | |
| **Hans Ott** | [**@hansott**](https://github.com/hansott) | |
| **James Brown** | | |
| **Mads Andreasen** | [**@MadsAndreasenTechPeople**](https://github.com/MadsAndreasenTechPeople) | |
| **Manuel Ernst** | [**@seriousManual**](https://github.com/seriousManual) | |
| **Mark Cavage** | [**@mcavage**](https://github.com/mcavage) | |
| **Matthew Wright** | [**@farskipper**](https://github.com/farskipper) | |
| **Max Ogden** | [**@maxogden**](https://github.com/maxogden) | [**@maxogden@twitter**](https://twitter.com/maxogden) |
| **Monty Anderson** | [**@montyanderson**](https://github.com/montyanderson) | |
| **moro** | | |
| **Paolo Fragomeni** | [**@hxoht**](https://github.com/hxoht) | [**@hxoht@twitter**](https://twitter.com/hxoht) |
| **Pascal Temel** | [**@PascalTemel**](https://github.com/PascalTemel) | |
| **Patrick Pfeiffer** | | |
| **Pedro Teixeira** | [**@pgte**](https://github.com/pgte) | [**@pgte@twitter**](https://twitter.com/pgte) |
| **Pomke** | | |
| **Prayag Verma** | [**@pra85**](https://github.com/pra85) | |
| **Richard Littauer** | [**@RichardLitt**](https://github.com/RichardLitt) | |
| **Stephen Sawchuk** | | |
| **Super-User** | | |

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

@@ -0,0 +1,21 @@
# The MIT License (MIT)
**Copyright © 2012-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.

536
node_modules/levelup/README.md generated vendored Normal file
View File

@@ -0,0 +1,536 @@
# levelup
[![level badge][level-badge]](https://github.com/Level/awesome)
[![npm](https://img.shields.io/npm/v/levelup.svg?label=&logo=npm)](https://www.npmjs.com/package/levelup)
[![Node version](https://img.shields.io/node/v/levelup.svg)](https://www.npmjs.com/package/levelup)
[![Travis](https://img.shields.io/travis/com/Level/levelup.svg?logo=travis&label=)](https://travis-ci.com/Level/levelup)
[![npm](https://img.shields.io/npm/dm/levelup.svg?label=dl)](https://www.npmjs.com/package/levelup)
[![Coverage Status](https://coveralls.io/repos/github/Level/levelup/badge.svg)](https://coveralls.io/github/Level/levelup)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![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)
- [Supported Platforms](#supported-platforms)
- [Usage](#usage)
- [API](#api)
- [Promise Support](#promise-support)
- [Events](#events)
- [Multi-process Access](#multi-process-access)
- [Contributing](#contributing)
- [Big Thanks](#big-thanks)
- [Donate](#donate)
- [License](#license)
</details>
## Introduction
**Fast and simple storage. A Node.js wrapper for `abstract-leveldown` compliant stores, which follow the characteristics of [LevelDB](https://github.com/google/leveldb).**
LevelDB is a simple key-value store built by Google. It's used in Google Chrome and many other products. LevelDB supports arbitrary byte arrays as both keys and values, singular _get_, _put_ and _delete_ operations, _batched put and delete_, bi-directional iterators and simple compression using the very fast [Snappy](http://google.github.io/snappy/) algorithm.
LevelDB stores entries sorted lexicographically by keys. This makes the <a href="#createReadStream">streaming interface</a> of `levelup` - which exposes LevelDB iterators as [Readable Streams](https://nodejs.org/docs/latest/api/stream.html#stream_readable_streams) - a very powerful query mechanism.
The most common store is [`leveldown`](https://github.com/Level/leveldown/) which provides a pure C++ binding to LevelDB. [Many alternative stores are available](https://github.com/Level/awesome/#stores) such as [`level.js`](https://github.com/Level/level.js) in the browser or [`memdown`](https://github.com/Level/memdown) for an in-memory store. They typically support strings and Buffers for both keys and values. For a richer set of data types you can wrap the store with [`encoding-down`](https://github.com/Level/encoding-down).
**The [`level`](https://github.com/Level/level) package is the recommended way to get started.** It conveniently bundles `levelup`, [`leveldown`](https://github.com/Level/leveldown/) and [`encoding-down`](https://github.com/Level/encoding-down). Its main export is `levelup` - i.e. you can do `var db = require('level')`.
## Supported Platforms
We aim to support Active LTS and Current Node.js releases as well as browsers. For support of the underlying store, please see the respective documentation. 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.
[![Sauce Test Status](https://saucelabs.com/browser-matrix/levelup.svg)](https://saucelabs.com/u/levelup)
## Usage
**If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md).
First you need to install `levelup`! No stores are included so you must also install `leveldown` (for example).
```sh
$ npm install levelup leveldown
```
All operations are asynchronous. If you do not provide a callback, [a Promise is returned](#promise-support).
```js
var levelup = require('levelup')
var leveldown = require('leveldown')
// 1) Create our store
var db = levelup(leveldown('./mydb'))
// 2) Put a key & value
db.put('name', 'levelup', 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)
})
})
```
## API
- <a href="#ctor"><code><b>levelup()</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>
### Special Notes
- <a href="#writeStreams">What happened to <code><b>db.createWriteStream()</b></code></a>
<a name="ctor"></a>
### `levelup(db[, options[, callback]])`
The main entry point for creating a new `levelup` instance.
- `db` must be an [`abstract-leveldown`](https://github.com/Level/abstract-leveldown) compliant store.
- `options` is passed on to the underlying store when opened and is specific to the type of store being used
Calling `levelup(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, unless it fails to open, in which case an `error` event will be emitted.
This leads to two alternative ways of managing a `levelup` instance:
```js
levelup(leveldown(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 = levelup(leveldown(location), options)
db.get('foo', function (err, value) {
if (err) return console.log('foo does not exist')
console.log('got foo =', value)
})
```
<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([options][, 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.
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.
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.
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.
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!') })
```
<b><code>batch.put(key, value)</code></b>
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`).
<b><code>batch.del(key)</code></b>
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.
<b><code>batch.clear()</code></b>
Clear all queued operations on the current batch, any previous operations will be discarded.
<b><code>batch.length</code></b>
The number of queued operations on the current batch.
<b><code>batch.write(\[options]\[, callback])</code></b>
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.
The optional `options` object is passed to the `.write()` operation of the underlying batch object.
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()`
_See <a href="#put"><code>isOpen()</code></a>_
`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`
<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/#abstractleveldown_iteratoroptions), 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.
<a name="writeStreams"></a>
#### What happened to `db.createWriteStream`?
`db.createWriteStream()` has been removed in order to provide a smaller and more maintainable core. It primarily existed to create symmetry with `db.createReadStream()` but through much [discussion](https://github.com/Level/levelup/issues/199), removing it was the best course of action.
The main driver for this was performance. While `db.createReadStream()` performs well under most use cases, `db.createWriteStream()` was highly dependent on the application keys and values. Thus we can't provide a standard implementation and encourage more `write-stream` implementations to be created to solve the broad spectrum of use cases.
Check out the implementations that the community has produced [here](https://github.com/Level/awesome#streams).
## Promise Support
`levelup` ships with native `Promise` support out of the box.
Each function accepting a callback returns 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()`
The only exception is the `levelup` constructor itself, which if no callback is passed will lazily open the underlying store in the background.
Example:
```js
var db = levelup(leveldown('./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
const main = async () => {
const db = levelup(leveldown('./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) |
| `clear` | Entries were deleted | `options` (object) |
| `opening` | Underlying store is opening | - |
| `open` | Store has opened | - |
| `ready` | Alias of `open` | - |
| `closing` | Store is closing | - |
| `closed` | Store has closed. | - |
| `error` | An error occurred | `error` (Error) |
For example you can do:
```js
db.on('put', function (key, value) {
console.log('inserted', { key, value })
})
```
## Multi-process Access
Stores like LevelDB are thread-safe but they are **not** suitable for accessing with multiple processes. You should only ever have a store open from a single Node.js process. Node.js clusters are made up of multiple processes so a `levelup` instance cannot be shared between them either.
See [`Level/awesome`](https://github.com/Level/awesome#shared-access) for modules like [`multileveldown`](https://github.com/mafintosh/multileveldown) that may help if you require a single store to be shared across processes.
## Contributing
[`Level/levelup`](https://github.com/Level/levelup) 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.
## Big Thanks
Cross-browser Testing Platform and Open Source ♥ Provided by [Sauce Labs](https://saucelabs.com).
[![Sauce Labs logo](./sauce-labs.svg)](https://saucelabs.com)
## 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) © 2012-present [Contributors](CONTRIBUTORS.md).
[level-badge]: https://leveljs.org/img/badge.svg

85
node_modules/levelup/UPGRADING.md generated vendored Normal file
View File

@@ -0,0 +1,85 @@
# 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).
## v4
There have been two major updates to dependencies. First, `level-iterator-stream` is now based on [`readable-stream@3`](https://github.com/nodejs/readable-stream#version-3xx). Second, `deferred-leveldown` is now based on [`abstract-leveldown@6`](https://github.com/Level/abstract-leveldown/blob/master/UPGRADING.md#v6). Please follow these links for more information; both contain significant enough changes to warrant this `levelup` major. In addition, all aforementioned dependencies and by extension `levelup` have dropped support of IE10.
To get a consistent behavior between opening and opened `levelup` instances (in the former case, your store will be wrapped with `deferred-leveldown`), we recommend to pair `levelup@4` only with a store based on `abstract-leveldown` >= 6. For example, `deferred-leveldown` now rejects `null` and `undefined` values. If you pair `levelup@4` with an older store, `db.put('key', null)` would only throw an error if `db` is still opening itself.
## v3
1. Dropped support for node 4.
2. Batch operations no longer default to `'put'`. If `type` isn't specified, an error will be thrown, courtesy of `abstract-leveldown`.
## v2
### Summary
There has been quite some work done for this new major version:
1. Make `levelup` more generic by reducing focus on [`leveldown`](https://github.com/Level/leveldown) and [`LevelDB`](https://github.com/google/leveldb).
2. Make `levelup` more generic by removing code related to encodings, which would allow \*down implementations to manage encodings themselves.
3. Use [`standard`](https://github.com/standard/standard) as linter to avoid bikeshedding.
4. Add a native `Promise` API for promise using geeks. Many have been asking for this. Also `async/await` is awesome. Breaking change: previously, if you did not pass a callback to an async function and there was an error, `levelup` would emit an `error` event instead. This is no longer true.
Point `1` and `2` also helps out with reducing complexity.
### Upgrade Guide
Since `levelup` no longer tries to load `leveldown` as a default backend you have to provide a backend instance yourself.
So if you previously did:
```
$ npm i levelup leveldown --save
```
And in your code you did something like:
```js
const levelup = require('levelup')
const db = levelup('/path/to/db')
```
You should now do (for identical functionality):
```js
const levelup = require('levelup')
const encode = require('encoding-down')
const leveldown = require('leveldown')
const db = levelup(encode(leveldown('/path/to/db')))
```
Note that we have moved out encodings into [`encoding-down`](https://github.com/level/encoding-down), which in itself is a \*down that wraps a \*down (meta ftw). It basically just sits in between `levelup` and the _actual_ backend to operate on encodings for keys and values. Default encoding is `'utf8'` like before.
This obviously means everyone has to do a lot of code rewrite which is bad. So we aim to fix this by putting that code into [`level@2.0.0`](https://github.com/level/level), which already is used as a convenience package.
Switching from `levelup` and `leveldown` combo to only using `level` you would do:
```js
const level = require('level')
const db = level('/path/to/db')
```
Also, we aim to simplify using `memdown` in the same way by updating `level-mem`.
For more advanced usage with custom versions of `abstract-leveldown`, the first parameter to `levelup()` should be an `abstract-leveldown` instead of passing a factory function via `options.db`.
So if you previously did:
```js
const db = levelup('/path/to/db', {
db: function (location) {
return new CustomLevelDOWN(location)
}
})
```
You should now do (for identical functionality):
```js
const encode = require('encoding-down')
const db = levelup(encode(new CustomLevelDOWN('/path/to/db')))
```

80
node_modules/levelup/lib/batch.js generated vendored Normal file
View File

@@ -0,0 +1,80 @@
var WriteError = require('level-errors').WriteError
var promisify = require('./promisify')
var getCallback = require('./common').getCallback
var getOptions = require('./common').getOptions
function Batch (levelup) {
// TODO (next major): remove this._levelup alias
this.db = this._levelup = levelup
this.batch = levelup.db.batch()
this.ops = []
this.length = 0
}
Batch.prototype.put = function (key, value) {
try {
this.batch.put(key, value)
} catch (e) {
throw new WriteError(e)
}
this.ops.push({ type: 'put', key: key, value: value })
this.length++
return this
}
Batch.prototype.del = function (key) {
try {
this.batch.del(key)
} catch (err) {
throw new WriteError(err)
}
this.ops.push({ type: 'del', key: key })
this.length++
return this
}
Batch.prototype.clear = function () {
try {
this.batch.clear()
} catch (err) {
throw new WriteError(err)
}
this.ops = []
this.length = 0
return this
}
Batch.prototype.write = function (options, callback) {
var levelup = this._levelup
var ops = this.ops
var promise
callback = getCallback(options, callback)
if (!callback) {
callback = promisify()
promise = callback.promise
}
options = getOptions(options)
try {
this.batch.write(options, function (err) {
if (err) { return callback(new WriteError(err)) }
levelup.emit('batch', ops)
callback()
})
} catch (err) {
throw new WriteError(err)
}
return promise
}
module.exports = Batch

7
node_modules/levelup/lib/common.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
exports.getCallback = function (options, callback) {
return typeof options === 'function' ? options : callback
}
exports.getOptions = function (options) {
return typeof options === 'object' && options !== null ? options : {}
}

345
node_modules/levelup/lib/levelup.js generated vendored Normal file
View File

@@ -0,0 +1,345 @@
var EventEmitter = require('events').EventEmitter
var inherits = require('util').inherits
var extend = require('xtend')
var DeferredLevelDOWN = require('deferred-leveldown')
var IteratorStream = require('level-iterator-stream')
var Batch = require('./batch')
var errors = require('level-errors')
var supports = require('level-supports')
var assert = require('assert')
var promisify = require('./promisify')
var getCallback = require('./common').getCallback
var getOptions = require('./common').getOptions
var WriteError = errors.WriteError
var ReadError = errors.ReadError
var NotFoundError = errors.NotFoundError
var OpenError = errors.OpenError
var InitializationError = errors.InitializationError
// Possible AbstractLevelDOWN#status values:
// - 'new' - newly created, not opened or closed
// - 'opening' - waiting for the database to be opened, post open()
// - 'open' - successfully opened the database, available for use
// - 'closing' - waiting for the database to be closed, post close()
// - 'closed' - database has been successfully closed, should not be
// used except for another open() operation
function LevelUP (db, options, callback) {
if (!(this instanceof LevelUP)) {
return new LevelUP(db, options, callback)
}
var error
var self = this
EventEmitter.call(this)
this.setMaxListeners(Infinity)
if (typeof options === 'function') {
callback = options
options = {}
}
options = options || {}
if (!db || typeof db !== 'object') {
error = new InitializationError('First argument must be an abstract-leveldown compliant store')
if (typeof callback === 'function') {
return process.nextTick(callback, error)
}
throw error
}
assert.strictEqual(typeof db.status, 'string', '.status required, old abstract-leveldown')
this.options = getOptions(options)
this._db = db
this.db = new DeferredLevelDOWN(db)
this.open(callback || function (err) {
if (err) self.emit('error', err)
})
// Create manifest based on deferred-leveldown's
this.supports = supports(this.db.supports, {
status: false,
deferredOpen: true,
openCallback: true,
promises: true,
streams: true
})
// Experimental: enrich levelup interface
Object.keys(this.supports.additionalMethods).forEach(function (method) {
if (this[method] != null) return
// Don't do this.db[method].bind() because this.db is dynamic.
this[method] = function () {
return this.db[method].apply(this.db, arguments)
}
}, this)
}
LevelUP.prototype.emit = EventEmitter.prototype.emit
LevelUP.prototype.once = EventEmitter.prototype.once
inherits(LevelUP, EventEmitter)
LevelUP.prototype.open = function (opts, callback) {
var self = this
var promise
if (typeof opts === 'function') {
callback = opts
opts = null
}
if (!callback) {
callback = promisify()
promise = callback.promise
}
if (!opts) {
opts = this.options
}
if (this.isOpen()) {
process.nextTick(callback, null, self)
return promise
}
if (this._isOpening()) {
this.once('open', function () { callback(null, self) })
return promise
}
this.emit('opening')
this.db.open(opts, function (err) {
if (err) {
return callback(new OpenError(err))
}
self.db = self._db
callback(null, self)
self.emit('open')
self.emit('ready')
})
return promise
}
LevelUP.prototype.close = function (callback) {
var self = this
var promise
if (!callback) {
callback = promisify()
promise = callback.promise
}
if (this.isOpen()) {
this.db.close(function () {
self.emit('closed')
callback.apply(null, arguments)
})
this.emit('closing')
this.db = new DeferredLevelDOWN(this._db)
} else if (this.isClosed()) {
process.nextTick(callback)
} else if (this.db.status === 'closing') {
this.once('closed', callback)
} else if (this._isOpening()) {
this.once('open', function () {
self.close(callback)
})
}
return promise
}
LevelUP.prototype.isOpen = function () {
return this.db.status === 'open'
}
LevelUP.prototype._isOpening = function () {
return this.db.status === 'opening'
}
LevelUP.prototype.isClosed = function () {
return (/^clos|new/).test(this.db.status)
}
LevelUP.prototype.get = function (key, options, callback) {
var promise
callback = getCallback(options, callback)
if (!callback) {
callback = promisify()
promise = callback.promise
}
if (maybeError(this, callback)) { return promise }
options = getOptions(options)
this.db.get(key, options, function (err, value) {
if (err) {
if ((/notfound/i).test(err) || err.notFound) {
err = new NotFoundError('Key not found in database [' + key + ']', err)
} else {
err = new ReadError(err)
}
return callback(err)
}
callback(null, value)
})
return promise
}
LevelUP.prototype.put = function (key, value, options, callback) {
var self = this
var promise
callback = getCallback(options, callback)
if (!callback) {
callback = promisify()
promise = callback.promise
}
if (maybeError(this, callback)) { return promise }
options = getOptions(options)
this.db.put(key, value, options, function (err) {
if (err) {
return callback(new WriteError(err))
}
self.emit('put', key, value)
callback()
})
return promise
}
LevelUP.prototype.del = function (key, options, callback) {
var self = this
var promise
callback = getCallback(options, callback)
if (!callback) {
callback = promisify()
promise = callback.promise
}
if (maybeError(this, callback)) { return promise }
options = getOptions(options)
this.db.del(key, options, function (err) {
if (err) {
return callback(new WriteError(err))
}
self.emit('del', key)
callback()
})
return promise
}
LevelUP.prototype.batch = function (arr, options, callback) {
if (!arguments.length) {
return new Batch(this)
}
var self = this
var promise
if (typeof arr === 'function') callback = arr
else callback = getCallback(options, callback)
if (!callback) {
callback = promisify()
promise = callback.promise
}
if (maybeError(this, callback)) { return promise }
options = getOptions(options)
this.db.batch(arr, options, function (err) {
if (err) {
return callback(new WriteError(err))
}
self.emit('batch', arr)
callback()
})
return promise
}
LevelUP.prototype.iterator = function (options) {
return this.db.iterator(options)
}
LevelUP.prototype.clear = function (options, callback) {
var self = this
var promise
callback = getCallback(options, callback)
options = getOptions(options)
if (!callback) {
callback = promisify()
promise = callback.promise
}
if (maybeError(this, callback)) {
return promise
}
this.db.clear(options, function (err) {
if (err) {
return callback(new WriteError(err))
}
self.emit('clear', options)
callback()
})
return promise
}
LevelUP.prototype.readStream =
LevelUP.prototype.createReadStream = function (options) {
options = extend({ keys: true, values: true }, options)
if (typeof options.limit !== 'number') { options.limit = -1 }
return new IteratorStream(this.db.iterator(options), options)
}
LevelUP.prototype.keyStream =
LevelUP.prototype.createKeyStream = function (options) {
return this.createReadStream(extend(options, { keys: true, values: false }))
}
LevelUP.prototype.valueStream =
LevelUP.prototype.createValueStream = function (options) {
return this.createReadStream(extend(options, { keys: false, values: true }))
}
LevelUP.prototype.toString = function () {
return 'LevelUP'
}
LevelUP.prototype.type = 'levelup'
function maybeError (db, callback) {
if (!db._isOpening() && !db.isOpen()) {
process.nextTick(callback, new ReadError('Database is not open'))
return true
}
}
LevelUP.errors = errors
module.exports = LevelUP.default = LevelUP

13
node_modules/levelup/lib/promisify.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
function promisify () {
var callback
var promise = new Promise(function (resolve, reject) {
callback = function callback (err, value) {
if (err) reject(err)
else resolve(value)
}
})
callback.promise = promise
return callback
}
module.exports = promisify

70
node_modules/levelup/package.json generated vendored Normal file
View File

@@ -0,0 +1,70 @@
{
"name": "levelup",
"version": "4.4.0",
"description": "Fast & simple storage - a Node.js-style LevelDB wrapper",
"license": "MIT",
"main": "lib/levelup.js",
"scripts": {
"test": "standard && hallmark && (nyc -s node test/self.js | faucet) && nyc report",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"test-browsers": "airtap --loopback airtap.local test/self.js > airtap.log",
"test-browser-local": "airtap --local test/self.js",
"hallmark": "hallmark --fix",
"dependency-check": "dependency-check --no-dev .",
"prepublishOnly": "npm run dependency-check"
},
"dependencies": {
"deferred-leveldown": "~5.3.0",
"level-errors": "~2.0.0",
"level-iterator-stream": "~4.0.0",
"level-supports": "~1.0.0",
"xtend": "~4.0.0"
},
"devDependencies": {
"after": "^0.8.2",
"airtap": "^3.0.0",
"async-each": "^1.0.3",
"browserify": "^16.0.0",
"concat-stream": "^2.0.0",
"coveralls": "^3.0.2",
"delayed": "^2.0.0",
"dependency-check": "^4.1.0",
"encoding-down": "^6.2.0",
"faucet": "^0.0.1",
"hallmark": "^2.0.0",
"level-community": "^3.0.0",
"level-concat-iterator": "^2.0.1",
"memdown": "^5.0.0",
"nyc": "^14.0.0",
"pinkie": "^2.0.4",
"run-parallel": "^1.1.9",
"run-series": "^1.1.8",
"safe-buffer": "^5.1.0",
"simple-concat": "^1.0.0",
"sinon": "^7.4.2",
"standard": "^14.1.0",
"tape": "^4.7.0",
"trickle": "0.0.2"
},
"hallmark": {
"community": "level-community"
},
"repository": {
"type": "git",
"url": "https://github.com/Level/levelup.git"
},
"homepage": "https://github.com/Level/levelup",
"keywords": [
"level",
"leveldb",
"stream",
"database",
"db",
"store",
"storage",
"json"
],
"engines": {
"node": ">=6"
}
}

81
node_modules/levelup/sauce-labs.svg generated vendored Normal file
View File

@@ -0,0 +1,81 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="460"
height="64"
version="1.1"
viewBox="0 0 144.37044 20.09272">
<defs>
<style>
.cls-1{isolation:isolate;}
.cls-2{opacity:0.15;mix-blend-mode:multiply;}
.cls-3{fill:#fff;}
.cls-4{fill:#e1251b;}
.cls-5{fill:#474c55;}
</style>
</defs>
<title>Sauce Labs</title>
<g
transform="translate(-0.87516672,-1.0999856)"
style="isolation:isolate"
id="g3807"
class="cls-1">
<g
id="white">
<path
style="fill:#e1251b"
id="path3774"
d="M 3.33,14.05 A 8,8 0 0 1 2.79,11.13 8.17,8.17 0 0 1 11,3 8.77,8.77 0 0 1 12.15,3.08 l -0.92,0.93 h -0.25 a 7.15,7.15 0 0 0 -6.88,9.1 h 6.26 L 7.7,18 14,11.62 H 5.4 L 15.09,2 A 9.94,9.94 0 0 0 10.94,1.1 10.07,10.07 0 0 0 5.69,19.76 l 3,-5.67 z"
class="cls-4" />
<path
style="fill:#e1251b"
id="path3776"
d="m 16.19,2.54 -3,5.67 h 5.37 A 8.15,8.15 0 0 1 10.95,19.28 9.39,9.39 0 0 1 9.76,19.2 l 0.91,-0.92 h 0.28 A 7.15,7.15 0 0 0 18.1,11.13 7.83,7.83 0 0 0 17.83,9.19 h -6.26 l 2.61,-4.93 -6.42,6.39 h 8.62 L 6.8,20.31 A 10.07,10.07 0 0 0 16.19,2.54 Z"
class="cls-4" />
<path
style="fill:#474c55"
id="path3778"
d="m 26,17.35 0.86,-1.27 a 0.44,0.44 0 0 1 0.69,-0.09 4.09,4.09 0 0 0 2.76,1.16 1.94,1.94 0 0 0 2,-1.89 c 0,-1 -0.66,-1.62 -1.91,-2.44 -1.46,-1 -3.2,-2.22 -3.2,-4.44 0,-2.22 1.54,-4.62 5,-4.62 a 6.11,6.11 0 0 1 4,1.44 0.63,0.63 0 0 1 0.06,0.89 L 35.4,7.31 C 35.22,7.58 34.93,7.6 34.62,7.36 a 3.67,3.67 0 0 0 -2.51,-1 1.82,1.82 0 0 0 -1.89,1.73 c 0,0.89 0.6,1.33 1.93,2.22 1.33,0.89 3.42,2.2 3.42,4.64 0,2.6 -2,4.78 -5.3,4.78 A 6.21,6.21 0 0 1 26,18 c -0.14,-0.12 -0.25,-0.32 0,-0.65 z"
class="cls-5" />
<path
style="fill:#474c55"
id="path3780"
d="M 36.92,19 45.27,4 a 0.42,0.42 0 0 1 0.38,-0.24 h 0.2 A 0.32,0.32 0 0 1 46.16,4 l 4.09,15 a 0.44,0.44 0 0 1 -0.42,0.58 H 47.9 c -0.34,0 -0.52,-0.12 -0.58,-0.45 l -0.56,-2.46 h -5.53 l -1.29,2.46 a 0.79,0.79 0 0 1 -0.71,0.45 h -2 C 36.88,19.53 36.77,19.24 36.92,19 Z m 9.13,-4.73 -1,-4.84 v 0 l -2.42,4.84 z"
class="cls-5" />
<path
style="fill:#474c55"
id="path3782"
d="M 54.51,4.4 A 0.51,0.51 0 0 1 55,4 h 2.2 a 0.35,0.35 0 0 1 0.33,0.42 l -1.33,9.35 a 3.54,3.54 0 0 0 0,0.71 2.09,2.09 0 0 0 2.27,2.36 c 1.82,0 2.84,-1.18 3.11,-3 l 1.33,-9.37 a 0.47,0.47 0 0 1 0.44,-0.42 h 2.2 a 0.37,0.37 0 0 1 0.34,0.42 l -1.36,9.51 c -0.47,3.37 -2.82,5.84 -6.28,5.84 a 4.81,4.81 0 0 1 -5.07,-5 6.94,6.94 0 0 1 0.07,-0.89 z"
class="cls-5" />
<path
style="fill:#474c55"
id="path3784"
d="m 76.5,3.76 a 6,6 0 0 1 4.62,2.11 0.46,0.46 0 0 1 -0.09,0.62 l -1.2,1.15 a 0.49,0.49 0 0 1 -0.73,0 4,4 0 0 0 -2.75,-1.11 c -2.67,0 -5,2.76 -5,5.93 0,2.36 1.27,4.38 3.4,4.38 a 4.6,4.6 0 0 0 3,-1.31 c 0.29,-0.25 0.53,-0.2 0.71,0 L 79.68,17 a 0.53,0.53 0 0 1 -0.11,0.6 7.11,7.11 0 0 1 -5,2.16 c -3.84,0 -6.33,-3.09 -6.33,-6.91 C 68.22,7.62 71.9,3.76 76.5,3.76 Z"
class="cls-5" />
<path
style="fill:#474c55"
id="path3786"
d="m 85.3,4.4 a 0.47,0.47 0 0 1 0.42,-0.42 h 8.22 A 0.35,0.35 0 0 1 94.27,4.4 L 94,6.22 a 0.47,0.47 0 0 1 -0.44,0.43 h -5.69 l -0.51,3.64 h 4.71 a 0.36,0.36 0 0 1 0.33,0.42 l -0.26,1.84 a 0.49,0.49 0 0 1 -0.45,0.42 H 87 l -0.55,3.89 h 5.71 c 0.22,0 0.33,0.2 0.31,0.42 l -0.25,1.82 a 0.47,0.47 0 0 1 -0.44,0.43 H 83.54 A 0.34,0.34 0 0 1 83.23,19.1 Z"
class="cls-5" />
<path
style="fill:#e1251b"
id="path3788"
d="M 99.56,4.4 A 0.49,0.49 0 0 1 100,4 h 1 a 0.37,0.37 0 0 1 0.34,0.42 L 99.36,18 H 105 a 0.35,0.35 0 0 1 0.31,0.42 l -0.09,0.64 a 0.49,0.49 0 0 1 -0.44,0.43 h -7 a 0.36,0.36 0 0 1 -0.33,-0.43 z"
class="cls-4" />
<path
style="fill:#e1251b"
id="path3790"
d="m 107.15,19 8.2,-15 a 0.42,0.42 0 0 1 0.37,-0.24 h 0.2 A 0.32,0.32 0 0 1 116.23,4 l 4,15 a 0.47,0.47 0 0 1 -0.42,0.58 h -0.94 a 0.32,0.32 0 0 1 -0.33,-0.25 l -0.89,-3.66 h -6.93 l -1.89,3.66 a 0.47,0.47 0 0 1 -0.42,0.25 h -1 C 107.11,19.53 107,19.24 107.15,19 Z m 10,-4.71 L 115.44,7 h -0.14 l -3.8,7.28 z"
class="cls-4" />
<path
style="fill:#e1251b"
id="path3792"
d="m 130.94,11.71 a 3.37,3.37 0 0 1 1.88,3 4.67,4.67 0 0 1 -5,4.8 h -4.6 a 0.36,0.36 0 0 1 -0.33,-0.43 L 125,4.4 a 0.51,0.51 0 0 1 0.45,-0.42 h 4.42 a 3.42,3.42 0 0 1 3.57,3.53 4.44,4.44 0 0 1 -2.46,4.13 z m -2.8,6.29 a 3,3 0 0 0 2.86,-3.12 2.33,2.33 0 0 0 -2.38,-2.39 h -3.11 L 124.7,18 Z m 0.67,-7.09 c 1.64,0 2.7,-1.31 2.7,-3.26 0,-1.29 -0.66,-2.18 -1.95,-2.18 H 126.5 L 125.72,11 Z"
class="cls-4" />
<path
style="fill:#e1251b"
id="path3794"
d="m 135.56,17.19 0.35,-0.37 c 0.27,-0.27 0.45,-0.36 0.71,-0.11 a 4.32,4.32 0 0 0 3.29,1.55 2.65,2.65 0 0 0 2.8,-2.69 c 0,-1.4 -1.05,-2.22 -2.89,-3.28 -1.84,-1.06 -3,-2 -3,-4.05 0,-1.86 1.17,-4.48 4.81,-4.48 a 5.7,5.7 0 0 1 3.45,1.13 c 0.11,0.09 0.31,0.33 0,0.76 L 144.83,6 c -0.22,0.31 -0.44,0.4 -0.73,0.2 a 4.52,4.52 0 0 0 -2.64,-0.95 2.88,2.88 0 0 0 -3,2.79 c 0,1.25 0.85,2.07 2.25,2.82 2.13,1.16 3.75,2.25 3.75,4.54 0,2.46 -1.78,4.35 -4.86,4.35 a 5.69,5.69 0 0 1 -4.16,-1.91 c -0.08,-0.16 -0.17,-0.36 0.12,-0.65 z"
class="cls-4" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.3 KiB