summaryrefslogtreecommitdiff
path: root/includes/external/discord/node_modules/streamsearch
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-03-21 16:21:21 +0100
committerRaindropsSys <contact@minteck.org>2023-03-21 16:21:21 +0100
commit475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd (patch)
tree2cff46debf9c1e13892e7babff9deb6874ecb4b2 /includes/external/discord/node_modules/streamsearch
parent7ccc2de87f9e25c715dc09b9aba4eb5c66f80424 (diff)
downloadpluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.tar.gz
pluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.tar.bz2
pluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.zip
Updated 26 files and added 1074 files (automated)
Diffstat (limited to 'includes/external/discord/node_modules/streamsearch')
-rw-r--r--includes/external/discord/node_modules/streamsearch/.github/workflows/ci.yml24
-rw-r--r--includes/external/discord/node_modules/streamsearch/.github/workflows/lint.yml23
-rw-r--r--includes/external/discord/node_modules/streamsearch/LICENSE19
-rw-r--r--includes/external/discord/node_modules/streamsearch/README.md95
-rw-r--r--includes/external/discord/node_modules/streamsearch/package.json34
5 files changed, 195 insertions, 0 deletions
diff --git a/includes/external/discord/node_modules/streamsearch/.github/workflows/ci.yml b/includes/external/discord/node_modules/streamsearch/.github/workflows/ci.yml
new file mode 100644
index 0000000..29d5178
--- /dev/null
+++ b/includes/external/discord/node_modules/streamsearch/.github/workflows/ci.yml
@@ -0,0 +1,24 @@
+name: CI
+
+on:
+ pull_request:
+ push:
+ branches: [ master ]
+
+jobs:
+ tests-linux:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ node-version: [10.x, 12.x, 14.x, 16.x]
+ steps:
+ - uses: actions/checkout@v2
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+ - name: Install module
+ run: npm install
+ - name: Run tests
+ run: npm test
diff --git a/includes/external/discord/node_modules/streamsearch/.github/workflows/lint.yml b/includes/external/discord/node_modules/streamsearch/.github/workflows/lint.yml
new file mode 100644
index 0000000..9f9e1f5
--- /dev/null
+++ b/includes/external/discord/node_modules/streamsearch/.github/workflows/lint.yml
@@ -0,0 +1,23 @@
+name: lint
+
+on:
+ pull_request:
+ push:
+ branches: [ master ]
+
+env:
+ NODE_VERSION: 16.x
+
+jobs:
+ lint-js:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Use Node.js ${{ env.NODE_VERSION }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ env.NODE_VERSION }}
+ - name: Install ESLint + ESLint configs/plugins
+ run: npm install --only=dev
+ - name: Lint files
+ run: npm run lint
diff --git a/includes/external/discord/node_modules/streamsearch/LICENSE b/includes/external/discord/node_modules/streamsearch/LICENSE
new file mode 100644
index 0000000..9ea90e0
--- /dev/null
+++ b/includes/external/discord/node_modules/streamsearch/LICENSE
@@ -0,0 +1,19 @@
+Copyright Brian White. All rights reserved.
+
+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. \ No newline at end of file
diff --git a/includes/external/discord/node_modules/streamsearch/README.md b/includes/external/discord/node_modules/streamsearch/README.md
new file mode 100644
index 0000000..c3934d1
--- /dev/null
+++ b/includes/external/discord/node_modules/streamsearch/README.md
@@ -0,0 +1,95 @@
+Description
+===========
+
+streamsearch is a module for [node.js](http://nodejs.org/) that allows searching a stream using the Boyer-Moore-Horspool algorithm.
+
+This module is based heavily on the Streaming Boyer-Moore-Horspool C++ implementation by Hongli Lai [here](https://github.com/FooBarWidget/boyer-moore-horspool).
+
+
+Requirements
+============
+
+* [node.js](http://nodejs.org/) -- v10.0.0 or newer
+
+
+Installation
+============
+
+ npm install streamsearch
+
+Example
+=======
+
+```js
+ const { inspect } = require('util');
+
+ const StreamSearch = require('streamsearch');
+
+ const needle = Buffer.from('\r\n');
+ const ss = new StreamSearch(needle, (isMatch, data, start, end) => {
+ if (data)
+ console.log('data: ' + inspect(data.toString('latin1', start, end)));
+ if (isMatch)
+ console.log('match!');
+ });
+
+ const chunks = [
+ 'foo',
+ ' bar',
+ '\r',
+ '\n',
+ 'baz, hello\r',
+ '\n world.',
+ '\r\n Node.JS rules!!\r\n\r\n',
+ ];
+ for (const chunk of chunks)
+ ss.push(Buffer.from(chunk));
+
+ // output:
+ //
+ // data: 'foo'
+ // data: ' bar'
+ // match!
+ // data: 'baz, hello'
+ // match!
+ // data: ' world.'
+ // match!
+ // data: ' Node.JS rules!!'
+ // match!
+ // data: ''
+ // match!
+```
+
+
+API
+===
+
+Properties
+----------
+
+* **maxMatches** - < _integer_ > - The maximum number of matches. Defaults to `Infinity`.
+
+* **matches** - < _integer_ > - The current match count.
+
+
+Functions
+---------
+
+* **(constructor)**(< _mixed_ >needle, < _function_ >callback) - Creates and returns a new instance for searching for a _Buffer_ or _string_ `needle`. `callback` is called any time there is non-matching data and/or there is a needle match. `callback` will be called with the following arguments:
+
+ 1. `isMatch` - _boolean_ - Indicates whether a match has been found
+
+ 2. `data` - _mixed_ - If set, this contains data that did not match the needle.
+
+ 3. `start` - _integer_ - The index in `data` where the non-matching data begins (inclusive).
+
+ 4. `end` - _integer_ - The index in `data` where the non-matching data ends (exclusive).
+
+ 5. `isSafeData` - _boolean_ - Indicates if it is safe to store a reference to `data` (e.g. as-is or via `data.slice()`) or not, as in some cases `data` may point to a Buffer whose contents change over time.
+
+* **destroy**() - _(void)_ - Emits any last remaining unmatched data that may still be buffered and then resets internal state.
+
+* **push**(< _Buffer_ >chunk) - _integer_ - Processes `chunk`, searching for a match. The return value is the last processed index in `chunk` + 1.
+
+* **reset**() - _(void)_ - Resets internal state. Useful for when you wish to start searching a new/different stream for example.
+
diff --git a/includes/external/discord/node_modules/streamsearch/package.json b/includes/external/discord/node_modules/streamsearch/package.json
new file mode 100644
index 0000000..51df8f9
--- /dev/null
+++ b/includes/external/discord/node_modules/streamsearch/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "streamsearch",
+ "version": "1.1.0",
+ "author": "Brian White <mscdex@mscdex.net>",
+ "description": "Streaming Boyer-Moore-Horspool searching for node.js",
+ "main": "./lib/sbmh.js",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "devDependencies": {
+ "@mscdex/eslint-config": "^1.1.0",
+ "eslint": "^7.32.0"
+ },
+ "scripts": {
+ "test": "node test/test.js",
+ "lint": "eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js lib test",
+ "lint:fix": "npm run lint -- --fix"
+ },
+ "keywords": [
+ "stream",
+ "horspool",
+ "boyer-moore-horspool",
+ "boyer-moore",
+ "search"
+ ],
+ "licenses": [{
+ "type": "MIT",
+ "url": "http://github.com/mscdex/streamsearch/raw/master/LICENSE"
+ }],
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/mscdex/streamsearch.git"
+ }
+}