llonebot-dist 6.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. dist/default_config.json +68 -0
  2. dist/llonebot.js +48348 -0
  3. dist/llonebot.js.map +1 -0
  4. dist/node_modules/@borewit/text-codec/LICENSE.txt +9 -0
  5. dist/node_modules/@borewit/text-codec/README.md +76 -0
  6. dist/node_modules/@borewit/text-codec/lib/index.d.ts +8 -0
  7. dist/node_modules/@borewit/text-codec/lib/index.js +161 -0
  8. dist/node_modules/@borewit/text-codec/package.json +68 -0
  9. dist/node_modules/@minatojs/sql.js/LICENSE +44 -0
  10. dist/node_modules/@minatojs/sql.js/README.md +357 -0
  11. dist/node_modules/@minatojs/sql.js/dist/sql-wasm.d.ts +316 -0
  12. dist/node_modules/@minatojs/sql.js/dist/sql-wasm.js +225 -0
  13. dist/node_modules/@minatojs/sql.js/dist/sql-wasm.wasm +0 -0
  14. dist/node_modules/@minatojs/sql.js/package.json +58 -0
  15. dist/node_modules/@tokenizer/inflate/LICENSE +15 -0
  16. dist/node_modules/@tokenizer/inflate/README.md +114 -0
  17. dist/node_modules/@tokenizer/inflate/lib/GzipHandler.d.ts +6 -0
  18. dist/node_modules/@tokenizer/inflate/lib/GzipHandler.js +19 -0
  19. dist/node_modules/@tokenizer/inflate/lib/ZipHandler.d.ts +26 -0
  20. dist/node_modules/@tokenizer/inflate/lib/ZipHandler.js +233 -0
  21. dist/node_modules/@tokenizer/inflate/lib/ZipToken.d.ts +94 -0
  22. dist/node_modules/@tokenizer/inflate/lib/ZipToken.js +117 -0
  23. dist/node_modules/@tokenizer/inflate/lib/index.d.ts +3 -0
  24. dist/node_modules/@tokenizer/inflate/lib/index.js +2 -0
  25. dist/node_modules/@tokenizer/inflate/package.json +76 -0
  26. dist/node_modules/@tokenizer/token/README.md +19 -0
  27. dist/node_modules/@tokenizer/token/index.d.ts +30 -0
  28. dist/node_modules/@tokenizer/token/package.json +33 -0
  29. dist/node_modules/debug/LICENSE +20 -0
  30. dist/node_modules/debug/README.md +481 -0
  31. dist/node_modules/debug/package.json +64 -0
  32. dist/node_modules/debug/src/browser.js +272 -0
  33. dist/node_modules/debug/src/common.js +292 -0
  34. dist/node_modules/debug/src/index.js +10 -0
  35. dist/node_modules/debug/src/node.js +263 -0
  36. dist/node_modules/file-type/core.d.ts +253 -0
  37. dist/node_modules/file-type/core.js +1899 -0
  38. dist/node_modules/file-type/index.d.ts +98 -0
  39. dist/node_modules/file-type/index.js +86 -0
  40. dist/node_modules/file-type/license +9 -0
  41. dist/node_modules/file-type/package.json +288 -0
  42. dist/node_modules/file-type/readme.md +674 -0
  43. dist/node_modules/file-type/supported.js +356 -0
  44. dist/node_modules/file-type/util.js +60 -0
  45. dist/node_modules/ieee754/LICENSE +11 -0
  46. dist/node_modules/ieee754/README.md +51 -0
  47. dist/node_modules/ieee754/index.d.ts +10 -0
  48. dist/node_modules/ieee754/index.js +85 -0
  49. dist/node_modules/ieee754/package.json +52 -0
  50. dist/node_modules/ms/index.js +162 -0
  51. dist/node_modules/ms/license.md +21 -0
  52. dist/node_modules/ms/package.json +38 -0
  53. dist/node_modules/ms/readme.md +59 -0
  54. dist/node_modules/silk-wasm/LICENSE +21 -0
  55. dist/node_modules/silk-wasm/README.md +85 -0
  56. dist/node_modules/silk-wasm/lib/index.cjs +16 -0
  57. dist/node_modules/silk-wasm/lib/index.d.ts +70 -0
  58. dist/node_modules/silk-wasm/lib/index.mjs +16 -0
  59. dist/node_modules/silk-wasm/lib/silk.wasm +0 -0
  60. dist/node_modules/silk-wasm/lib/utils.d.ts +4 -0
  61. dist/node_modules/silk-wasm/package.json +39 -0
  62. dist/node_modules/strtok3/LICENSE.txt +21 -0
  63. dist/node_modules/strtok3/README.md +399 -0
  64. dist/node_modules/strtok3/lib/AbstractTokenizer.d.ts +76 -0
  65. dist/node_modules/strtok3/lib/AbstractTokenizer.js +108 -0
  66. dist/node_modules/strtok3/lib/BlobTokenizer.d.ts +29 -0
  67. dist/node_modules/strtok3/lib/BlobTokenizer.js +53 -0
  68. dist/node_modules/strtok3/lib/BufferTokenizer.d.ts +29 -0
  69. dist/node_modules/strtok3/lib/BufferTokenizer.js +52 -0
  70. dist/node_modules/strtok3/lib/FileTokenizer.d.ts +37 -0
  71. dist/node_modules/strtok3/lib/FileTokenizer.js +61 -0
  72. dist/node_modules/strtok3/lib/ReadStreamTokenizer.d.ts +31 -0
  73. dist/node_modules/strtok3/lib/ReadStreamTokenizer.js +102 -0
  74. dist/node_modules/strtok3/lib/core.d.ts +40 -0
  75. dist/node_modules/strtok3/lib/core.js +62 -0
  76. dist/node_modules/strtok3/lib/index.d.ts +16 -0
  77. dist/node_modules/strtok3/lib/index.js +22 -0
  78. dist/node_modules/strtok3/lib/stream/AbstractStreamReader.d.ts +54 -0
  79. dist/node_modules/strtok3/lib/stream/AbstractStreamReader.js +71 -0
  80. dist/node_modules/strtok3/lib/stream/Deferred.d.ts +6 -0
  81. dist/node_modules/strtok3/lib/stream/Deferred.js +10 -0
  82. dist/node_modules/strtok3/lib/stream/Errors.d.ts +10 -0
  83. dist/node_modules/strtok3/lib/stream/Errors.js +16 -0
  84. dist/node_modules/strtok3/lib/stream/StreamReader.d.ts +29 -0
  85. dist/node_modules/strtok3/lib/stream/StreamReader.js +83 -0
  86. dist/node_modules/strtok3/lib/stream/WebStreamByobReader.d.ts +14 -0
  87. dist/node_modules/strtok3/lib/stream/WebStreamByobReader.js +27 -0
  88. dist/node_modules/strtok3/lib/stream/WebStreamDefaultReader.d.ts +19 -0
  89. dist/node_modules/strtok3/lib/stream/WebStreamDefaultReader.js +62 -0
  90. dist/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +14 -0
  91. dist/node_modules/strtok3/lib/stream/WebStreamReader.js +13 -0
  92. dist/node_modules/strtok3/lib/stream/WebStreamReaderFactory.d.ts +5 -0
  93. dist/node_modules/strtok3/lib/stream/WebStreamReaderFactory.js +19 -0
  94. dist/node_modules/strtok3/lib/stream/index.d.ts +6 -0
  95. dist/node_modules/strtok3/lib/stream/index.js +5 -0
  96. dist/node_modules/strtok3/lib/types.d.ts +139 -0
  97. dist/node_modules/strtok3/lib/types.js +1 -0
  98. dist/node_modules/strtok3/package.json +94 -0
  99. dist/node_modules/token-types/LICENSE.txt +9 -0
  100. dist/node_modules/token-types/README.md +120 -0
  101. dist/node_modules/token-types/lib/index.d.ts +135 -0
  102. dist/node_modules/token-types/lib/index.js +401 -0
  103. dist/node_modules/token-types/package.json +81 -0
  104. dist/node_modules/uint8array-extras/index.d.ts +312 -0
  105. dist/node_modules/uint8array-extras/index.js +321 -0
  106. dist/node_modules/uint8array-extras/license +9 -0
  107. dist/node_modules/uint8array-extras/package.json +54 -0
  108. dist/node_modules/uint8array-extras/readme.md +301 -0
  109. dist/node_modules/ws/LICENSE +20 -0
  110. dist/node_modules/ws/README.md +548 -0
  111. dist/node_modules/ws/browser.js +8 -0
  112. dist/node_modules/ws/index.js +13 -0
  113. dist/node_modules/ws/lib/buffer-util.js +131 -0
  114. dist/node_modules/ws/lib/constants.js +18 -0
  115. dist/node_modules/ws/lib/event-target.js +292 -0
  116. dist/node_modules/ws/lib/extension.js +203 -0
  117. dist/node_modules/ws/lib/limiter.js +55 -0
  118. dist/node_modules/ws/lib/permessage-deflate.js +528 -0
  119. dist/node_modules/ws/lib/receiver.js +706 -0
  120. dist/node_modules/ws/lib/sender.js +602 -0
  121. dist/node_modules/ws/lib/stream.js +161 -0
  122. dist/node_modules/ws/lib/subprotocol.js +62 -0
  123. dist/node_modules/ws/lib/validation.js +152 -0
  124. dist/node_modules/ws/lib/websocket-server.js +550 -0
  125. dist/node_modules/ws/lib/websocket.js +1388 -0
  126. dist/node_modules/ws/package.json +69 -0
  127. dist/node_modules/ws/wrapper.mjs +8 -0
  128. dist/package.json +1 -0
  129. dist/webui/assets/index-B9vGhdCO.js +256 -0
  130. dist/webui/assets/index-DaqFU7JR.css +1 -0
  131. dist/webui/index.html +13 -0
  132. dist/webui/logo.jpg +0 -0
  133. dist//344/275/277/347/224/250/350/257/264/346/230/216.txt +11 -0
  134. dist//346/233/264/346/226/260/346/227/245/345/277/227.txt +399 -0
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
+
5
+ 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:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ 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.
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "uint8array-extras",
3
+ "version": "1.4.0",
4
+ "description": "Useful utilities for working with Uint8Array (and Buffer)",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/uint8array-extras",
7
+ "funding": "https://github.com/sponsors/sindresorhus",
8
+ "author": {
9
+ "name": "Sindre Sorhus",
10
+ "email": "sindresorhus@gmail.com",
11
+ "url": "https://sindresorhus.com"
12
+ },
13
+ "type": "module",
14
+ "exports": {
15
+ "types": "./index.d.ts",
16
+ "default": "./index.js"
17
+ },
18
+ "sideEffects": false,
19
+ "engines": {
20
+ "node": ">=18"
21
+ },
22
+ "scripts": {
23
+ "test": "xo && ava && tsc index.d.ts"
24
+ },
25
+ "files": [
26
+ "index.js",
27
+ "index.d.ts"
28
+ ],
29
+ "keywords": [
30
+ "uint8array",
31
+ "uint8",
32
+ "typedarray",
33
+ "buffer",
34
+ "typedarray",
35
+ "arraybuffer",
36
+ "is",
37
+ "assert",
38
+ "concat",
39
+ "equals",
40
+ "compare",
41
+ "base64",
42
+ "string",
43
+ "atob",
44
+ "btoa",
45
+ "hex",
46
+ "hexadecimal"
47
+ ],
48
+ "devDependencies": {
49
+ "ava": "^6.0.1",
50
+ "typescript": "^5.3.3",
51
+ "xo": "^0.56.0",
52
+ "benchmark": "2.1.4"
53
+ }
54
+ }
@@ -0,0 +1,301 @@
1
+ # uint8array-extras
2
+
3
+ > Useful utilities for working with [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) (and [`Buffer`](https://nodejs.org/api/buffer.html))
4
+
5
+ It's time to [transition from `Buffer` to `Uint8Array`](https://sindresorhus.com/blog/goodbye-nodejs-buffer), and this package helps fill in the gaps.
6
+
7
+ Note that `Buffer` is a `Uint8Array` subclass, so you can use this package with `Buffer` too.
8
+
9
+ This package is tree-shakeable and browser-compatible.
10
+
11
+ This package also includes methods to convert a string to Base64 and back.
12
+
13
+ Note: In the browser, do not use [`globalThis.atob()`](https://developer.mozilla.org/en-US/docs/Web/API/atob) / [`globalThis.btoa()`](https://developer.mozilla.org/en-US/docs/Web/API/btoa) because they [do not support Unicode](https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem). This package does.
14
+
15
+ ## Install
16
+
17
+ ```sh
18
+ npm install uint8array-extras
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```js
24
+ import {concatUint8Arrays} from 'uint8array-extras';
25
+
26
+ const a = new Uint8Array([1, 2, 3]);
27
+ const b = new Uint8Array([4, 5, 6]);
28
+
29
+ console.log(concatUint8Arrays([a, b]));
30
+ //=> Uint8Array [1, 2, 3, 4, 5, 6]
31
+ ```
32
+
33
+ ## API
34
+
35
+ ### `isUint8Array(value: unknown): boolean`
36
+
37
+ Check if the given value is an instance of `Uint8Array`.
38
+
39
+ Replacement for [`Buffer.isBuffer()`](https://nodejs.org/api/buffer.html#static-method-bufferisbufferobj).
40
+
41
+ ```js
42
+ import {isUint8Array} from 'uint8array-extras';
43
+
44
+ console.log(isUint8Array(new Uint8Array()));
45
+ //=> true
46
+
47
+ console.log(isUint8Array(Buffer.from('x')));
48
+ //=> true
49
+
50
+ console.log(isUint8Array(new ArrayBuffer(10)));
51
+ //=> false
52
+ ```
53
+
54
+ ### `assertUint8Array(value: unknown)`
55
+
56
+ Throw a `TypeError` if the given value is not an instance of `Uint8Array`.
57
+
58
+ ```js
59
+ import {assertUint8Array} from 'uint8array-extras';
60
+
61
+ try {
62
+ assertUint8Array(new ArrayBuffer(10)); // Throws a TypeError
63
+ } catch (error) {
64
+ console.error(error.message);
65
+ }
66
+ ```
67
+
68
+ ### `toUint8Array(value: TypedArray | ArrayBuffer | DataView): Uint8Array`
69
+
70
+ Convert a value to a `Uint8Array` without copying its data.
71
+
72
+ This can be useful for converting a `Buffer` to a pure `Uint8Array`. `Buffer` is already an `Uint8Array` subclass, but [`Buffer` alters some behavior](https://sindresorhus.com/blog/goodbye-nodejs-buffer), so it can be useful to cast it to a pure `Uint8Array` before returning it.
73
+
74
+ Tip: If you want a copy, just call `.slice()` on the return value.
75
+
76
+ ### `concatUint8Arrays(arrays: Uint8Array[], totalLength?: number): Uint8Array`
77
+
78
+ Concatenate the given arrays into a new array.
79
+
80
+ If `arrays` is empty, it will return a zero-sized `Uint8Array`.
81
+
82
+ If `totalLength` is not specified, it is calculated from summing the lengths of the given arrays.
83
+
84
+ Replacement for [`Buffer.concat()`](https://nodejs.org/api/buffer.html#static-method-bufferconcatlist-totallength).
85
+
86
+ ```js
87
+ import {concatUint8Arrays} from 'uint8array-extras';
88
+
89
+ const a = new Uint8Array([1, 2, 3]);
90
+ const b = new Uint8Array([4, 5, 6]);
91
+
92
+ console.log(concatUint8Arrays([a, b]));
93
+ //=> Uint8Array [1, 2, 3, 4, 5, 6]
94
+ ```
95
+
96
+ ### `areUint8ArraysEqual(a: Uint8Array, b: Uint8Array): boolean`
97
+
98
+ Check if two arrays are identical by verifying that they contain the same bytes in the same sequence.
99
+
100
+ Replacement for [`Buffer#equals()`](https://nodejs.org/api/buffer.html#bufequalsotherbuffer).
101
+
102
+ ```js
103
+ import {areUint8ArraysEqual} from 'uint8array-extras';
104
+
105
+ const a = new Uint8Array([1, 2, 3]);
106
+ const b = new Uint8Array([1, 2, 3]);
107
+ const c = new Uint8Array([4, 5, 6]);
108
+
109
+ console.log(areUint8ArraysEqual(a, b));
110
+ //=> true
111
+
112
+ console.log(areUint8ArraysEqual(a, c));
113
+ //=> false
114
+ ```
115
+
116
+ ### `compareUint8Arrays(a: Uint8Array, b: Uint8Array): 0 | 1 | -1`
117
+
118
+ Compare two arrays and indicate their relative order or equality. Useful for sorting.
119
+
120
+ Replacement for [`Buffer.compare()`](https://nodejs.org/api/buffer.html#static-method-buffercomparebuf1-buf2).
121
+
122
+ ```js
123
+ import {compareUint8Arrays} from 'uint8array-extras';
124
+
125
+ const array1 = new Uint8Array([1, 2, 3]);
126
+ const array2 = new Uint8Array([4, 5, 6]);
127
+ const array3 = new Uint8Array([7, 8, 9]);
128
+
129
+ [array3, array1, array2].sort(compareUint8Arrays);
130
+ //=> [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
131
+ ```
132
+
133
+ ### `uint8ArrayToString(array: Uint8Array | ArrayBuffer, encoding?: string = 'utf8'): string`
134
+
135
+ Convert a `Uint8Array` to a string.
136
+
137
+ - Parameter: `encoding` - The [encoding](https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings) to convert from.
138
+
139
+ Replacement for [`Buffer#toString()`](https://nodejs.org/api/buffer.html#buftostringencoding-start-end). For the `encoding` parameter, `latin1` should be used instead of `binary` and `utf-16le` instead of `utf16le`.
140
+
141
+ ```js
142
+ import {uint8ArrayToString} from 'uint8array-extras';
143
+
144
+ const byteArray = new Uint8Array([72, 101, 108, 108, 111]);
145
+ console.log(uint8ArrayToString(byteArray));
146
+ //=> 'Hello'
147
+
148
+ const zh = new Uint8Array([167, 65, 166, 110]);
149
+ console.log(uint8ArrayToString(zh, 'big5'));
150
+ //=> '你好'
151
+
152
+ const ja = new Uint8Array([130, 177, 130, 241, 130, 201, 130, 191, 130, 205]);
153
+ console.log(uint8ArrayToString(ja, 'shift-jis'));
154
+ //=> 'こんにちは'
155
+ ```
156
+
157
+ ### `stringToUint8Array(string: string): Uint8Array`
158
+
159
+ Convert a string to a `Uint8Array` (using UTF-8 encoding).
160
+
161
+ Replacement for [`Buffer.from('Hello')`](https://nodejs.org/api/buffer.html#static-method-bufferfromstring-encoding).
162
+
163
+ ```js
164
+ import {stringToUint8Array} from 'uint8array-extras';
165
+
166
+ console.log(stringToUint8Array('Hello'));
167
+ //=> Uint8Array [72, 101, 108, 108, 111]
168
+ ```
169
+
170
+ ### `uint8ArrayToBase64(array: Uint8Array, options?: {urlSafe: boolean}): string`
171
+
172
+ Convert a `Uint8Array` to a Base64-encoded string.
173
+
174
+ Specify `{urlSafe: true}` to get a [Base64URL](https://base64.guru/standards/base64url)-encoded string.
175
+
176
+ Replacement for [`Buffer#toString('base64')`](https://nodejs.org/api/buffer.html#buftostringencoding-start-end).
177
+
178
+ ```js
179
+ import {uint8ArrayToBase64} from 'uint8array-extras';
180
+
181
+ const byteArray = new Uint8Array([72, 101, 108, 108, 111]);
182
+
183
+ console.log(uint8ArrayToBase64(byteArray));
184
+ //=> 'SGVsbG8='
185
+ ```
186
+
187
+ ### `base64ToUint8Array(string: string): Uint8Array`
188
+
189
+ Convert a Base64-encoded or [Base64URL](https://base64.guru/standards/base64url)-encoded string to a `Uint8Array`.
190
+
191
+ Replacement for [`Buffer.from('SGVsbG8=', 'base64')`](https://nodejs.org/api/buffer.html#static-method-bufferfromstring-encoding).
192
+
193
+ ```js
194
+ import {base64ToUint8Array} from 'uint8array-extras';
195
+
196
+ console.log(base64ToUint8Array('SGVsbG8='));
197
+ //=> Uint8Array [72, 101, 108, 108, 111]
198
+ ```
199
+
200
+ ### `stringToBase64(string: string, options?: {urlSafe: boolean}): string`
201
+
202
+ Encode a string to Base64-encoded string.
203
+
204
+ Specify `{urlSafe: true}` to get a [Base64URL](https://base64.guru/standards/base64url)-encoded string.
205
+
206
+ Replacement for `Buffer.from('Hello').toString('base64')` and [`btoa()`](https://developer.mozilla.org/en-US/docs/Web/API/btoa).
207
+
208
+ ```js
209
+ import {stringToBase64} from 'uint8array-extras';
210
+
211
+ console.log(stringToBase64('Hello'));
212
+ //=> 'SGVsbG8='
213
+ ```
214
+
215
+ ### `base64ToString(base64String: string): string`
216
+
217
+ Decode a Base64-encoded or [Base64URL](https://base64.guru/standards/base64url)-encoded string to a string.
218
+
219
+ Replacement for `Buffer.from('SGVsbG8=', 'base64').toString()` and [`atob()`](https://developer.mozilla.org/en-US/docs/Web/API/atob).
220
+
221
+ ```js
222
+ import {base64ToString} from 'uint8array-extras';
223
+
224
+ console.log(base64ToString('SGVsbG8='));
225
+ //=> 'Hello'
226
+ ```
227
+
228
+ ### `uint8ArrayToHex(array: Uint8Array): string`
229
+
230
+ Convert a `Uint8Array` to a Hex string.
231
+
232
+ Replacement for [`Buffer#toString('hex')`](https://nodejs.org/api/buffer.html#buftostringencoding-start-end).
233
+
234
+ ```js
235
+ import {uint8ArrayToHex} from 'uint8array-extras';
236
+
237
+ const byteArray = new Uint8Array([72, 101, 108, 108, 111]);
238
+
239
+ console.log(uint8ArrayToHex(byteArray));
240
+ //=> '48656c6c6f'
241
+ ```
242
+
243
+ ### `hexToUint8Array(hexString: string): Uint8Array`
244
+
245
+ Convert a Hex string to a `Uint8Array`.
246
+
247
+ Replacement for [`Buffer.from('48656c6c6f', 'hex')`](https://nodejs.org/api/buffer.html#static-method-bufferfromstring-encoding).
248
+
249
+ ```js
250
+ import {hexToUint8Array} from 'uint8array-extras';
251
+
252
+ console.log(hexToUint8Array('48656c6c6f'));
253
+ //=> Uint8Array [72, 101, 108, 108, 111]
254
+ ```
255
+
256
+ ### `getUintBE(view: DataView): number`
257
+
258
+ Read `DataView#byteLength` number of bytes from the given view, up to 48-bit.
259
+
260
+ Replacement for [`Buffer#readUintBE`](https://nodejs.org/api/buffer.html#bufreadintbeoffset-bytelength)
261
+
262
+ ```js
263
+ import {getUintBE} from 'uint8array-extras';
264
+
265
+ const byteArray = new Uint8Array([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
266
+
267
+ console.log(getUintBE(new DataView(byteArray.buffer)));
268
+ //=> 20015998341291
269
+ ```
270
+
271
+ ### `indexOf(array: Uint8Array, value: Uint8Array): number`
272
+
273
+ Find the index of the first occurrence of the given sequence of bytes (`value`) within the given `Uint8Array` (`array`).
274
+
275
+ Replacement for [`Buffer#indexOf`](https://nodejs.org/api/buffer.html#bufindexofvalue-byteoffset-encoding). `Uint8Array#indexOf` only takes a number which is different from Buffer's `indexOf` implementation.
276
+
277
+ ```js
278
+ import {indexOf} from 'uint8array-extras';
279
+
280
+ const byteArray = new Uint8Array([0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef]);
281
+
282
+ console.log(indexOf(byteArray, new Uint8Array([0x78, 0x90])));
283
+ //=> 3
284
+ ```
285
+
286
+ ### `includes(array: Uint8Array, value: Uint8Array): boolean`
287
+
288
+ Checks if the given sequence of bytes (`value`) is within the given `Uint8Array` (`array`).
289
+
290
+ Returns true if the value is included, otherwise false.
291
+
292
+ Replacement for [`Buffer#includes`](https://nodejs.org/api/buffer.html#bufincludesvalue-byteoffset-encoding). `Uint8Array#includes` only takes a number which is different from Buffer's `includes` implementation.
293
+
294
+ ```js
295
+ import {includes} from 'uint8array-extras';
296
+
297
+ const byteArray = new Uint8Array([0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef]);
298
+
299
+ console.log(includes(byteArray, new Uint8Array([0x78, 0x90])));
300
+ //=> true
301
+ ```
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
2
+ Copyright (c) 2013 Arnout Kazemier and contributors
3
+ Copyright (c) 2016 Luigi Pinca and contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.