@thi.ng/bencode 2.1.126 → 2.1.128

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-07-06T12:02:18Z
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
@@ -1,13 +1,13 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
2
  <!-- Please see: https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md#changes-to-readme-files -->
3
- # ![@thi.ng/bencode](https://media.thi.ng/umbrella/banners-20230807/thing-bencode.svg?772c96a2)
3
+ # ![@thi.ng/bencode](https://media.thi.ng/umbrella/banners-20230807/thing-bencode.svg?30a38d1a)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/bencode.svg)](https://www.npmjs.com/package/@thi.ng/bencode)
6
6
  ![npm downloads](https://img.shields.io/npm/dm/@thi.ng/bencode.svg)
7
7
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  > [!NOTE]
10
- > This is one of 188 standalone projects, maintained as part
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 */ : isArrayLike(x) ? 5 /* LIST */ : isPlainObject(x) ? 4 /* DICT */ : unsupported(`unsupported data type: ${x}`),
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.126",
3
+ "version": "2.1.128",
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.10",
40
- "@thi.ng/checks": "^3.6.7",
41
- "@thi.ng/defmulti": "^3.0.43",
42
- "@thi.ng/errors": "^2.5.11",
43
- "@thi.ng/strings": "^3.7.37",
44
- "@thi.ng/transducers": "^9.0.9",
45
- "@thi.ng/transducers-binary": "^2.1.124"
39
+ "@thi.ng/arrays": "^2.9.12",
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.11",
45
+ "@thi.ng/transducers-binary": "^2.1.126"
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": "ba4f2cd15eeb0cae30efe222524da4fed2a57267\n"
86
+ "gitHead": "324d6b7dbf31558329e9fb6452e29b2f7db9c61a\n"
87
87
  }