@thi.ng/transducers-binary 2.0.7 → 2.1.2
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 +106 -50
- package/README.md +1 -1
- package/bits.js +1 -1
- package/package.json +107 -102
package/CHANGELOG.md
CHANGED
|
@@ -1,103 +1,159 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
- **Last updated**: 2021-11-21T17:09:28Z
|
|
4
|
+
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
|
+
|
|
3
6
|
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
|
+
See [Conventional Commits](https://conventionalcommits.org/) for commit guidelines.
|
|
8
|
+
|
|
9
|
+
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
|
+
and/or version bumps of transitive dependencies.
|
|
11
|
+
|
|
12
|
+
## [2.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@2.1.0) (2021-11-17)
|
|
13
|
+
|
|
14
|
+
#### 🚀 Features
|
|
15
|
+
|
|
16
|
+
- Using workspaces for local tools ([bf7a404](https://github.com/thi-ng/umbrella/commit/bf7a404))
|
|
17
|
+
Improving the overall build ergonomics
|
|
18
|
+
- introduced a tools workspaces
|
|
19
|
+
- imported it in all needed packages/examples
|
|
20
|
+
- inclusive project root
|
|
21
|
+
|
|
22
|
+
#### ♻️ Refactoring
|
|
23
|
+
|
|
24
|
+
- testrunner to binary ([4ebbbb2](https://github.com/thi-ng/umbrella/commit/4ebbbb2))
|
|
25
|
+
this commit reverts (partly) changes made in:
|
|
26
|
+
ef346d7a8753590dc9094108a3d861a8dbd5dd2c
|
|
27
|
+
overall purpose is better testament ergonomics:
|
|
28
|
+
instead of having to pass NODE_OPTIONS with every invocation
|
|
29
|
+
having a binary to handle this for us.
|
|
30
|
+
|
|
31
|
+
### [2.0.8](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@2.0.8) (2021-11-10)
|
|
32
|
+
|
|
33
|
+
#### ♻️ Refactoring
|
|
5
34
|
|
|
6
|
-
|
|
35
|
+
- update all countdown loops ([a5f374b](https://github.com/thi-ng/umbrella/commit/a5f374b))
|
|
7
36
|
|
|
8
|
-
|
|
37
|
+
### [2.0.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@2.0.1) (2021-10-13)
|
|
9
38
|
|
|
39
|
+
#### ♻️ Refactoring
|
|
10
40
|
|
|
41
|
+
- update imports in all tests/pkgs ([effd591](https://github.com/thi-ng/umbrella/commit/effd591))
|
|
42
|
+
- update imports in all pkgs ([5fa2b6f](https://github.com/thi-ng/umbrella/commit/5fa2b6f))
|
|
43
|
+
- add .js suffix for all relative imports
|
|
11
44
|
|
|
45
|
+
# [2.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@2.0.0) (2021-10-12)
|
|
12
46
|
|
|
47
|
+
#### 🛑 Breaking changes
|
|
13
48
|
|
|
14
|
-
|
|
49
|
+
- major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea))
|
|
50
|
+
- BREAKING CHANGE: discontinue CommonJS & UMD versions
|
|
51
|
+
- only ESM modules will be published from now on
|
|
52
|
+
- CJS obsolete due to ESM support in recent versions of node:
|
|
53
|
+
- i.e. launch NodeJS via:
|
|
54
|
+
- `node --experimental-specifier-resolution=node --experimental-repl-await`
|
|
55
|
+
- in the node REPL use `await import(...)` instead of `require()`
|
|
56
|
+
- UMD obsolete due to widespread browser support for ESM
|
|
57
|
+
Also:
|
|
58
|
+
- normalize/restructure/reorg all package.json files
|
|
59
|
+
- cleanup all build scripts, remove obsolete
|
|
60
|
+
- switch from mocha to [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament) for all tests
|
|
15
61
|
|
|
62
|
+
#### 🚀 Features
|
|
16
63
|
|
|
17
|
-
|
|
64
|
+
- update return types ([70217e8](https://github.com/thi-ng/umbrella/commit/70217e8))
|
|
65
|
+
- return Uint8Array if input given for base64Decode() or utf8Encode()
|
|
66
|
+
- update asBytes() return type (if input given)
|
|
18
67
|
|
|
19
|
-
|
|
68
|
+
#### ♻️ Refactoring
|
|
20
69
|
|
|
70
|
+
- update imports ([924aa26](https://github.com/thi-ng/umbrella/commit/924aa26))
|
|
71
|
+
- update imports ([138571a](https://github.com/thi-ng/umbrella/commit/138571a))
|
|
72
|
+
- update all test stubs ([f2d6d53](https://github.com/thi-ng/umbrella/commit/f2d6d53))
|
|
73
|
+
- update all tests in _all_ pkgs ([8b582bc](https://github.com/thi-ng/umbrella/commit/8b582bc))
|
|
74
|
+
- update all to use [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament)
|
|
21
75
|
|
|
22
|
-
|
|
76
|
+
## [0.6.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@0.6.0) (2020-12-22)
|
|
23
77
|
|
|
24
|
-
|
|
78
|
+
#### 🛑 Breaking changes
|
|
25
79
|
|
|
80
|
+
- fix [#256](https://github.com/thi-ng/umbrella/issues/256) replace enum w/ type alias ([50cc52a](https://github.com/thi-ng/umbrella/commit/50cc52a))
|
|
81
|
+
- BREAKING CHANGE: replace Type enum w/ type alias, update BinStructItem
|
|
26
82
|
|
|
27
|
-
###
|
|
83
|
+
### [0.5.33](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@0.5.33) (2020-12-07)
|
|
28
84
|
|
|
29
|
-
|
|
85
|
+
#### ♻️ Refactoring
|
|
30
86
|
|
|
31
|
-
- only
|
|
32
|
-
- CJS obsolete due to ESM support in recent versions of node:
|
|
33
|
-
- i.e. launch NodeJS via:
|
|
34
|
-
- `node --experimental-specifier-resolution=node --experimental-repl-await`
|
|
35
|
-
- in the node REPL use `await import(...)` instead of `require()`
|
|
36
|
-
- UMD obsolete due to widespread browser support for ESM
|
|
87
|
+
- update type-only imports in various tests/pkgs ([3fd9c24](https://github.com/thi-ng/umbrella/commit/3fd9c24))
|
|
37
88
|
|
|
38
|
-
|
|
39
|
-
- normalize/restructure/reorg all package.json files
|
|
40
|
-
- cleanup all build scripts, remove obsolete
|
|
41
|
-
- switch from mocha to @thi.ng/testament for all tests
|
|
89
|
+
### [0.5.31](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@0.5.31) (2020-11-24)
|
|
42
90
|
|
|
91
|
+
#### ♻️ Refactoring
|
|
43
92
|
|
|
93
|
+
- replace dependency for hexDump() ([7af7a92](https://github.com/thi-ng/umbrella/commit/7af7a92))
|
|
94
|
+
- use formatters from [@thi.ng/hex](https://github.com/thi-ng/umbrella/tree/main/packages/hex) instead of [@thi.ng/strings](https://github.com/thi-ng/umbrella/tree/main/packages/strings)
|
|
44
95
|
|
|
96
|
+
### [0.5.6](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@0.5.6) (2020-04-05)
|
|
45
97
|
|
|
98
|
+
#### ♻️ Refactoring
|
|
46
99
|
|
|
100
|
+
- switch to non-const enums ([acc1fbf](https://github.com/thi-ng/umbrella/commit/acc1fbf))
|
|
47
101
|
|
|
48
|
-
##
|
|
102
|
+
## [0.5.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@0.5.0) (2020-02-25)
|
|
49
103
|
|
|
50
|
-
|
|
104
|
+
#### 🚀 Features
|
|
51
105
|
|
|
52
|
-
|
|
106
|
+
- add missing type impls to asBytes() ([6514292](https://github.com/thi-ng/umbrella/commit/6514292))
|
|
107
|
+
- add asBytes() transducer ([b8589d4](https://github.com/thi-ng/umbrella/commit/b8589d4))
|
|
108
|
+
- add hexDumpString() syntax sugar ([a3ad805](https://github.com/thi-ng/umbrella/commit/a3ad805))
|
|
109
|
+
- update bytes(), add i24/u24 support ([6d658d0](https://github.com/thi-ng/umbrella/commit/6d658d0))
|
|
110
|
+
- also fix stride for u16
|
|
53
111
|
|
|
54
|
-
|
|
112
|
+
#### ♻️ Refactoring
|
|
55
113
|
|
|
56
|
-
-
|
|
114
|
+
- update imports ([f4b4698](https://github.com/thi-ng/umbrella/commit/f4b4698))
|
|
115
|
+
- minor update bits() ([b78f166](https://github.com/thi-ng/umbrella/commit/b78f166))
|
|
57
116
|
|
|
58
|
-
###
|
|
117
|
+
### [0.4.4](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@0.4.4) (2019-08-21)
|
|
59
118
|
|
|
60
|
-
|
|
119
|
+
#### ♻️ Refactoring
|
|
61
120
|
|
|
62
|
-
|
|
121
|
+
- remove duplicate code in bytes(), update ut8Length ([021fd6f](https://github.com/thi-ng/umbrella/commit/021fd6f))
|
|
63
122
|
|
|
64
|
-
|
|
123
|
+
## [0.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@0.4.0) (2019-07-07)
|
|
65
124
|
|
|
66
|
-
|
|
67
|
-
- **transducers-binary:** add hexDumpString() syntax sugar ([a3ad805](https://github.com/thi-ng/umbrella/commit/a3ad805aefa4dd3836d7fb00cfbf0cf147b9d059))
|
|
68
|
-
- **transducers-binary:** add missing type impls to asBytes() ([6514292](https://github.com/thi-ng/umbrella/commit/65142927f520d0a90ca4f4bd5b7d570527e72923))
|
|
69
|
-
- **transducers-binary:** update bytes(), add i24/u24 support ([6d658d0](https://github.com/thi-ng/umbrella/commit/6d658d072977009f1289ba2cf230970dabf55d7f))
|
|
125
|
+
#### 🚀 Features
|
|
70
126
|
|
|
71
|
-
|
|
127
|
+
- enable TS strict compiler flags (refactor) ([8d86ac6](https://github.com/thi-ng/umbrella/commit/8d86ac6))
|
|
72
128
|
|
|
73
|
-
|
|
129
|
+
#### ♻️ Refactoring
|
|
74
130
|
|
|
75
|
-
-
|
|
131
|
+
- address TS strictNullChecks flag ([4769638](https://github.com/thi-ng/umbrella/commit/4769638))
|
|
76
132
|
|
|
77
|
-
|
|
133
|
+
### [0.3.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@0.3.1) (2019-03-05)
|
|
78
134
|
|
|
79
|
-
|
|
135
|
+
#### 🩹 Bug fixes
|
|
80
136
|
|
|
81
|
-
-
|
|
137
|
+
- add randomBits() return type ([d79481f](https://github.com/thi-ng/umbrella/commit/d79481f))
|
|
82
138
|
|
|
83
|
-
|
|
139
|
+
## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@0.3.0) (2019-03-04)
|
|
84
140
|
|
|
85
|
-
|
|
141
|
+
#### 🚀 Features
|
|
86
142
|
|
|
87
|
-
-
|
|
143
|
+
- add randomBits(), update readme ([36ca046](https://github.com/thi-ng/umbrella/commit/36ca046))
|
|
88
144
|
|
|
89
|
-
|
|
145
|
+
## [0.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@0.2.0) (2019-02-15)
|
|
90
146
|
|
|
91
|
-
|
|
147
|
+
#### 🚀 Features
|
|
92
148
|
|
|
93
|
-
-
|
|
149
|
+
- add utf8Length() ([7cf98ef](https://github.com/thi-ng/umbrella/commit/7cf98ef))
|
|
94
150
|
|
|
95
|
-
|
|
151
|
+
#### 🩹 Bug fixes
|
|
96
152
|
|
|
97
|
-
-
|
|
153
|
+
- update juxt import ([77ed4c5](https://github.com/thi-ng/umbrella/commit/77ed4c5))
|
|
98
154
|
|
|
99
|
-
|
|
155
|
+
## [0.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers-binary@0.1.0) (2019-02-05)
|
|
100
156
|
|
|
101
|
-
|
|
157
|
+
#### 🚀 Features
|
|
102
158
|
|
|
103
|
-
-
|
|
159
|
+
- extract as new pkg from [@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/main/packages/transducers) ([02877c7](https://github.com/thi-ng/umbrella/commit/02877c7))
|
package/README.md
CHANGED
package/bits.js
CHANGED
|
@@ -9,7 +9,7 @@ export function bits(...args) {
|
|
|
9
9
|
const msb = args[1] !== false;
|
|
10
10
|
return compR(rfn, msb
|
|
11
11
|
? (acc, x) => {
|
|
12
|
-
for (let i = size; --
|
|
12
|
+
for (let i = size; i-- > 0 && !isReduced(acc);) {
|
|
13
13
|
acc = reduce(acc, (x >>> i) & 1);
|
|
14
14
|
}
|
|
15
15
|
return acc;
|
package/package.json
CHANGED
|
@@ -1,111 +1,116 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
"name": "@thi.ng/transducers-binary",
|
|
3
|
+
"version": "2.1.2",
|
|
4
|
+
"description": "Binary data related transducers & reducers",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "./index.js",
|
|
7
|
+
"typings": "./index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/thi-ng/umbrella.git"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/transducers-binary#readme",
|
|
14
|
+
"funding": [
|
|
15
|
+
{
|
|
16
|
+
"type": "github",
|
|
17
|
+
"url": "https://github.com/sponsors/postspectacular"
|
|
12
18
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
{
|
|
20
|
+
"type": "patreon",
|
|
21
|
+
"url": "https://patreon.com/thing_umbrella"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"author": "Karsten Schmidt <k+npm@thi.ng>",
|
|
25
|
+
"license": "Apache-2.0",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "yarn clean && tsc --declaration",
|
|
28
|
+
"clean": "rimraf '*.js' '*.d.ts' '*.map' doc",
|
|
29
|
+
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
|
|
30
|
+
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
31
|
+
"doc:readme": "yarn doc:stats && tools:readme",
|
|
32
|
+
"doc:stats": "tools:module-stats",
|
|
33
|
+
"pub": "yarn npm publish --access public",
|
|
34
|
+
"test": "testament test"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@thi.ng/binary": "^3.1.2",
|
|
38
|
+
"@thi.ng/compose": "^2.1.2",
|
|
39
|
+
"@thi.ng/errors": "^2.1.2",
|
|
40
|
+
"@thi.ng/hex": "^2.1.2",
|
|
41
|
+
"@thi.ng/random": "^3.2.2",
|
|
42
|
+
"@thi.ng/transducers": "^8.1.2"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@microsoft/api-extractor": "^7.18.19",
|
|
46
|
+
"@thi.ng/testament": "^0.2.2",
|
|
47
|
+
"rimraf": "^3.0.2",
|
|
48
|
+
"tools": "^0.0.1",
|
|
49
|
+
"typedoc": "^0.22.9",
|
|
50
|
+
"typescript": "^4.5.2"
|
|
51
|
+
},
|
|
52
|
+
"keywords": [
|
|
53
|
+
"array",
|
|
54
|
+
"base64",
|
|
55
|
+
"binary",
|
|
56
|
+
"decode",
|
|
57
|
+
"encode",
|
|
58
|
+
"hexdump",
|
|
59
|
+
"iterator",
|
|
60
|
+
"partition",
|
|
61
|
+
"stream",
|
|
62
|
+
"transducer",
|
|
63
|
+
"typedarray",
|
|
64
|
+
"typescript",
|
|
65
|
+
"utf8"
|
|
66
|
+
],
|
|
67
|
+
"publishConfig": {
|
|
68
|
+
"access": "public"
|
|
69
|
+
},
|
|
70
|
+
"engines": {
|
|
71
|
+
"node": ">=12.7"
|
|
72
|
+
},
|
|
73
|
+
"files": [
|
|
74
|
+
"*.js",
|
|
75
|
+
"*.d.ts"
|
|
76
|
+
],
|
|
77
|
+
"exports": {
|
|
78
|
+
".": {
|
|
79
|
+
"import": "./index.js"
|
|
35
80
|
},
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
"@thi.ng/compose": "^2.0.7",
|
|
39
|
-
"@thi.ng/errors": "^2.0.6",
|
|
40
|
-
"@thi.ng/hex": "^2.0.6",
|
|
41
|
-
"@thi.ng/random": "^3.1.3",
|
|
42
|
-
"@thi.ng/transducers": "^8.0.7"
|
|
81
|
+
"./api": {
|
|
82
|
+
"import": "./api.js"
|
|
43
83
|
},
|
|
44
|
-
"
|
|
45
|
-
|
|
84
|
+
"./base64": {
|
|
85
|
+
"import": "./base64.js"
|
|
46
86
|
},
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
"base64",
|
|
50
|
-
"binary",
|
|
51
|
-
"decode",
|
|
52
|
-
"encode",
|
|
53
|
-
"hexdump",
|
|
54
|
-
"iterator",
|
|
55
|
-
"partition",
|
|
56
|
-
"stream",
|
|
57
|
-
"transducer",
|
|
58
|
-
"typedarray",
|
|
59
|
-
"typescript",
|
|
60
|
-
"utf8"
|
|
61
|
-
],
|
|
62
|
-
"publishConfig": {
|
|
63
|
-
"access": "public"
|
|
87
|
+
"./bits": {
|
|
88
|
+
"import": "./bits.js"
|
|
64
89
|
},
|
|
65
|
-
"
|
|
66
|
-
|
|
90
|
+
"./bytes": {
|
|
91
|
+
"import": "./bytes.js"
|
|
67
92
|
},
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
"*.d.ts"
|
|
71
|
-
],
|
|
72
|
-
"exports": {
|
|
73
|
-
".": {
|
|
74
|
-
"import": "./index.js"
|
|
75
|
-
},
|
|
76
|
-
"./api": {
|
|
77
|
-
"import": "./api.js"
|
|
78
|
-
},
|
|
79
|
-
"./base64": {
|
|
80
|
-
"import": "./base64.js"
|
|
81
|
-
},
|
|
82
|
-
"./bits": {
|
|
83
|
-
"import": "./bits.js"
|
|
84
|
-
},
|
|
85
|
-
"./bytes": {
|
|
86
|
-
"import": "./bytes.js"
|
|
87
|
-
},
|
|
88
|
-
"./hex-dump": {
|
|
89
|
-
"import": "./hex-dump.js"
|
|
90
|
-
},
|
|
91
|
-
"./partition-bits": {
|
|
92
|
-
"import": "./partition-bits.js"
|
|
93
|
-
},
|
|
94
|
-
"./random-bits": {
|
|
95
|
-
"import": "./random-bits.js"
|
|
96
|
-
},
|
|
97
|
-
"./utf8": {
|
|
98
|
-
"import": "./utf8.js"
|
|
99
|
-
}
|
|
93
|
+
"./hex-dump": {
|
|
94
|
+
"import": "./hex-dump.js"
|
|
100
95
|
},
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
"related": [
|
|
104
|
-
"binary",
|
|
105
|
-
"bitstream",
|
|
106
|
-
"unionstruct"
|
|
107
|
-
],
|
|
108
|
-
"year": 2018
|
|
96
|
+
"./partition-bits": {
|
|
97
|
+
"import": "./partition-bits.js"
|
|
109
98
|
},
|
|
110
|
-
"
|
|
111
|
-
|
|
99
|
+
"./random-bits": {
|
|
100
|
+
"import": "./random-bits.js"
|
|
101
|
+
},
|
|
102
|
+
"./utf8": {
|
|
103
|
+
"import": "./utf8.js"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"thi.ng": {
|
|
107
|
+
"parent": "@thi.ng/transducers",
|
|
108
|
+
"related": [
|
|
109
|
+
"binary",
|
|
110
|
+
"bitstream",
|
|
111
|
+
"unionstruct"
|
|
112
|
+
],
|
|
113
|
+
"year": 2018
|
|
114
|
+
},
|
|
115
|
+
"gitHead": "e8a7c2a40191b391cef182c2978e5a6c85987a87\n"
|
|
116
|
+
}
|