@thi.ng/bencode 2.1.127 → 2.1.129
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.
- package/CHANGELOG.md +9 -1
- package/README.md +1 -1
- package/encode.js +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-07-
|
|
3
|
+
- **Last updated**: 2024-07-22T13:15:57Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,14 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [2.1.128](https://github.com/thi-ng/umbrella/tree/@thi.ng/bencode@2.1.128) (2024-07-22)
|
|
13
|
+
|
|
14
|
+
#### 🩹 Bug fixes
|
|
15
|
+
|
|
16
|
+
- fix [#485](https://github.com/thi-ng/umbrella/issues/485), update encode() for arraylike objects ([8bd8912](https://github.com/thi-ng/umbrella/commit/8bd8912))
|
|
17
|
+
- switch order of type analysis in encode() dispatch
|
|
18
|
+
- add tests
|
|
19
|
+
|
|
12
20
|
### [2.1.123](https://github.com/thi-ng/umbrella/tree/@thi.ng/bencode@2.1.123) (2024-06-21)
|
|
13
21
|
|
|
14
22
|
#### ♻️ Refactoring
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 198 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/encode.js
CHANGED
|
@@ -27,7 +27,7 @@ var Lit = /* @__PURE__ */ ((Lit2) => {
|
|
|
27
27
|
const FLOAT_RE = /^[0-9.-]+$/;
|
|
28
28
|
const encode = (x, cap = 1024) => bytes(cap, __encodeBin(x));
|
|
29
29
|
const __encodeBin = defmulti(
|
|
30
|
-
(x) => isNumber(x) ? Math.floor(x) !== x ? 1 /* FLOAT */ : 0 /* INT */ : isBoolean(x) ? 0 /* INT */ : isString(x) ? 2 /* STR */ : x instanceof Uint8Array ? 3 /* BINARY */ :
|
|
30
|
+
(x) => isNumber(x) ? Math.floor(x) !== x ? 1 /* FLOAT */ : 0 /* INT */ : isBoolean(x) ? 0 /* INT */ : isString(x) ? 2 /* STR */ : x instanceof Uint8Array ? 3 /* BINARY */ : isPlainObject(x) ? 4 /* DICT */ : isArrayLike(x) ? 5 /* LIST */ : unsupported(`unsupported data type: ${x}`),
|
|
31
31
|
{},
|
|
32
32
|
{
|
|
33
33
|
[0 /* INT */]: (x) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/bencode",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.129",
|
|
4
4
|
"description": "Bencode binary encoder / decoder with optional UTF8 encoding & floating point support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/arrays": "^2.9.
|
|
40
|
-
"@thi.ng/checks": "^3.6.
|
|
41
|
-
"@thi.ng/defmulti": "^3.0.
|
|
42
|
-
"@thi.ng/errors": "^2.5.
|
|
43
|
-
"@thi.ng/strings": "^3.8.
|
|
44
|
-
"@thi.ng/transducers": "^9.0.
|
|
45
|
-
"@thi.ng/transducers-binary": "^2.1.
|
|
39
|
+
"@thi.ng/arrays": "^2.9.13",
|
|
40
|
+
"@thi.ng/checks": "^3.6.9",
|
|
41
|
+
"@thi.ng/defmulti": "^3.0.45",
|
|
42
|
+
"@thi.ng/errors": "^2.5.13",
|
|
43
|
+
"@thi.ng/strings": "^3.8.1",
|
|
44
|
+
"@thi.ng/transducers": "^9.0.12",
|
|
45
|
+
"@thi.ng/transducers-binary": "^2.1.127"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@microsoft/api-extractor": "^7.47.0",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"thi.ng": {
|
|
84
84
|
"alias": "bc"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "bd22b0826134b79064169371665b4d6caa9b6066\n"
|
|
87
87
|
}
|