@thi.ng/binary 3.4.18 → 3.4.19

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-03-07T20:40:47Z
3
+ - **Last updated**: 2024-03-13T14:04:31Z
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.
package/mask.d.ts CHANGED
@@ -4,11 +4,14 @@ import type { FnU2 } from "@thi.ng/api";
4
4
  * 0-32. `b` MUST be >= `a`.
5
5
  *
6
6
  * @example
7
- * ```ts
7
+ * ```ts tangle:../export/mask.ts
8
8
  * import { defMask } from "@thi.ng/binary";
9
9
  *
10
- * defMask(1,31).toString(16) // 7ffffffe
11
- * defMask(3,8).toString(16) // f8
10
+ * console.log(defMask(1,31).toString(16));
11
+ * // 7ffffffe
12
+ *
13
+ * console.log(defMask(3,8).toString(16));
14
+ * // f8
12
15
  * ```
13
16
  *
14
17
  * @param a - first bit
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/binary",
3
- "version": "3.4.18",
3
+ "version": "3.4.19",
4
4
  "description": "100+ assorted binary / bitwise operations, conversions, utilities, lookup tables",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -36,14 +36,14 @@
36
36
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@thi.ng/api": "^8.9.29"
39
+ "@thi.ng/api": "^8.9.30"
40
40
  },
41
41
  "devDependencies": {
42
- "@microsoft/api-extractor": "^7.40.1",
43
- "esbuild": "^0.20.0",
42
+ "@microsoft/api-extractor": "^7.42.3",
43
+ "esbuild": "^0.20.1",
44
44
  "rimraf": "^5.0.5",
45
- "typedoc": "^0.25.7",
46
- "typescript": "^5.3.3"
45
+ "typedoc": "^0.25.12",
46
+ "typescript": "^5.4.2"
47
47
  },
48
48
  "keywords": [
49
49
  "align",
@@ -133,5 +133,5 @@
133
133
  "transducers-binary"
134
134
  ]
135
135
  },
136
- "gitHead": "69100942474942f7446ac645d59d91e7dfc352f9\n"
136
+ "gitHead": "7f3fcbd6c0462b0ce45afa141fe163d1f297fd51\n"
137
137
  }
package/swizzle.d.ts CHANGED
@@ -77,12 +77,23 @@ export declare const setLane2: (x: number, y: number, lane: Lane2) => number;
77
77
  * Re-orders byte lanes in given order (MSB).
78
78
  *
79
79
  * @example
80
- * ```ts
81
- * import { swizzle } from "@thi.ng/binary";
82
- *
83
- * swizzle(0x12345678, 3, 2, 1, 0) // 0x78563412
84
- * swizzle(0x12345678, 1, 0, 3, 2) // 0x34127856
85
- * swizzle(0x12345678, 2, 2, 0, 0) // 0x56561212
80
+ * ```ts tangle:../export/swizzle.ts
81
+ * import { swizzle8 } from "@thi.ng/binary";
82
+ *
83
+ * console.log(
84
+ * swizzle8(0x12345678, 3, 2, 1, 0).toString(16)
85
+ * );
86
+ * // 0x78563412
87
+ *
88
+ * console.log(
89
+ * swizzle8(0x12345678, 1, 0, 3, 2).toString(16)
90
+ * );
91
+ * // 0x34127856
92
+ *
93
+ * console.log(
94
+ * swizzle8(0x12345678, 2, 2, 0, 0).toString(16)
95
+ * );
96
+ * // 0x56561212
86
97
  * ```
87
98
  *
88
99
  * @param x - value
@@ -110,13 +121,17 @@ export declare const swizzle4: (x: number, a: Lane4, b: Lane4, c: Lane4, d: Lane
110
121
  * are set.
111
122
  *
112
123
  * @example
113
- * ```ts
124
+ * ```ts tangle:../export/mux.ts
114
125
  * import { mux } from "@thi.ng/binary";
115
126
  *
116
- * mux(0x12345678, 0xaaaa5555, 0xffff0000)
127
+ * console.log(
128
+ * mux(0x12345678, 0xaaaa5555, 0xffff0000)
129
+ * );
117
130
  * // 0xaaaa5678
118
131
  *
119
- * mux(0x12345678, 0xaaaa5555, 0x0000ffff)
132
+ * console.log(
133
+ * mux(0x12345678, 0xaaaa5555, 0x0000ffff)
134
+ * );
120
135
  * // 0x12345555
121
136
  * ```
122
137
  *
@@ -135,10 +150,12 @@ export declare const flip8: FnN;
135
150
  * Swaps the highest & lowest 16 bits in `x`.
136
151
  *
137
152
  * @example
138
- * ```ts
153
+ * ```ts tangle:../export/flip16.ts
139
154
  * import { flip16 } from "@thi.ng/binary";
140
155
  *
141
- * flip16(0x12345678)
156
+ * console.log(
157
+ * flip16(0x12345678).toString(16)
158
+ * );
142
159
  * // 0x56781234
143
160
  * ```
144
161
  *