@thi.ng/bencode 3.0.47 → 3.0.50

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 (3) hide show
  1. package/README.md +2 -2
  2. package/encode.js +2 -2
  3. package/package.json +11 -10
package/README.md CHANGED
@@ -7,7 +7,7 @@
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 213 standalone projects, maintained as part
10
+ > This is one of 214 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
  >
@@ -92,7 +92,7 @@ For Node.js REPL:
92
92
  const bc = await import("@thi.ng/bencode");
93
93
  ```
94
94
 
95
- Package sizes (brotli'd, pre-treeshake): ESM: 1.22 KB
95
+ Package sizes (brotli'd, pre-treeshake): ESM: 1.21 KB
96
96
 
97
97
  ## Dependencies
98
98
 
package/encode.js CHANGED
@@ -4,7 +4,7 @@ import { isNumber } from "@thi.ng/checks/is-number";
4
4
  import { isPlainObject } from "@thi.ng/checks/is-plain-object";
5
5
  import { isString } from "@thi.ng/checks/is-string";
6
6
  import { assert } from "@thi.ng/errors/assert";
7
- import { unsupported } from "@thi.ng/errors/unsupported";
7
+ import { illegalArgs } from "@thi.ng/errors/illegal-arguments";
8
8
  import { utf8Length } from "@thi.ng/strings/utf8";
9
9
  import { bytes, str, u8, u8array } from "@thi.ng/transducers-binary/bytes";
10
10
  import { mapcat } from "@thi.ng/transducers/mapcat";
@@ -35,7 +35,7 @@ const ENCODERS = {
35
35
  ]
36
36
  };
37
37
  const encode = (x, cap = 1024) => bytes(cap, __encodeBin(x));
38
- const __encodeBin = (x) => ENCODERS[isNumber(x) ? Math.floor(x) !== x ? "f" : "i" : isBoolean(x) ? "i" : isString(x) ? "s" : x instanceof Uint8Array ? "b" : isPlainObject(x) ? "d" : isArrayLike(x) ? "l" : unsupported(`unsupported data type: ${x}`)](x);
38
+ const __encodeBin = (x) => ENCODERS[isNumber(x) ? Math.floor(x) !== x ? "f" : "i" : isBoolean(x) ? "i" : isString(x) ? "s" : x instanceof Uint8Array ? "b" : isPlainObject(x) ? "d" : isArrayLike(x) ? "l" : illegalArgs(`unsupported data type: ${x}`)](x);
39
39
  const __ensureValidNumber = (x) => {
40
40
  assert(isFinite(x), `can't encode infinite value`);
41
41
  assert(!isNaN(x), `can't encode NaN`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/bencode",
3
- "version": "3.0.47",
3
+ "version": "3.0.50",
4
4
  "description": "Bencode binary encoder / decoder with optional UTF8 encoding & floating point support",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -8,7 +8,8 @@
8
8
  "sideEffects": false,
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/thi-ng/umbrella.git"
11
+ "url": "git+https://github.com/thi-ng/umbrella.git",
12
+ "directory": "packages/bencode"
12
13
  },
13
14
  "homepage": "https://thi.ng/bencode",
14
15
  "funding": [
@@ -39,13 +40,13 @@
39
40
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
40
41
  },
41
42
  "dependencies": {
42
- "@thi.ng/api": "^8.12.13",
43
- "@thi.ng/arrays": "^2.14.6",
44
- "@thi.ng/checks": "^3.8.3",
45
- "@thi.ng/errors": "^2.6.2",
46
- "@thi.ng/strings": "^3.9.34",
47
- "@thi.ng/transducers": "^9.6.22",
48
- "@thi.ng/transducers-binary": "^2.1.194"
43
+ "@thi.ng/api": "^8.12.15",
44
+ "@thi.ng/arrays": "^2.14.9",
45
+ "@thi.ng/checks": "^3.8.5",
46
+ "@thi.ng/errors": "^2.6.4",
47
+ "@thi.ng/strings": "^3.9.36",
48
+ "@thi.ng/transducers": "^9.6.25",
49
+ "@thi.ng/transducers-binary": "^2.1.197"
49
50
  },
50
51
  "devDependencies": {
51
52
  "esbuild": "^0.27.2",
@@ -87,5 +88,5 @@
87
88
  "thi.ng": {
88
89
  "alias": "bc"
89
90
  },
90
- "gitHead": "828ec2e9ffde7307231b03cff46598c0915b1857\n"
91
+ "gitHead": "8f50352caab9ec7757d645c0afa605dfb5427abe\n"
91
92
  }