Skip to content

Commit 83608e8

Browse files
committed
Fix
1 parent 94efc1e commit 83608e8

File tree

7 files changed

+49
-7
lines changed

7 files changed

+49
-7
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,8 @@ jobs:
4444
with:
4545
deno-version: v2.x
4646

47+
- name: Install dependencies
48+
run: deno install
49+
4750
- name: Publish
4851
run: deno publish

inspect/node.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* eslint-env node */
2+
3+
import type util from "node:util";
4+
5+
/**
6+
* Custom inspect function for Node.js
7+
*
8+
* ```
9+
* Float16Array.prototype[Symbol.for("nodejs.util.inspect.custom")] = customInspect;
10+
* ```
11+
*/
12+
export function customInspect(this: ArrayLike<number>, _deps: number, options: util.InspectOptions, inspect: typeof util.inspect): string {
13+
const length = this.length;
14+
15+
const array = [];
16+
for (let i = 0; i < length; ++i) {
17+
array[i] = this[i];
18+
}
19+
20+
return `Float16Array(${length}) ${inspect(array, options)}`;
21+
}

jsr.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"name": "@petamoriken/float16",
33
"version": "3.9.0",
44
"exports": {
5-
".": "./mod.ts",
6-
"./inspect": "./inspect/node.mjs"
5+
".": "./src/index.mjs",
6+
"./inspect": "./inspect/node.ts"
77
},
88
"publish": {
99
"include": [
1010
"src",
11-
"inspect/node.mjs",
11+
"inspect/node.ts",
1212
"index.d.ts",
1313
"index.v5.6.d.ts",
1414
"index.v5.7.d.ts",
15-
"mod.ts"
15+
"README.md"
1616
]
1717
}
1818
}

mod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// @deno-types="./index.v5.6.d.ts"
1+
// @ts-self-types="./index.v5.6.d.ts"
22
export * from "./src/index.mjs";

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,14 @@
4545
"types": "./index.d.ts",
4646
"typesVersions": {
4747
">=5.7": {
48-
"index.d.ts": ["index.v5.7.d.ts"]
48+
"index.d.ts": [
49+
"index.v5.7.d.ts"
50+
]
4951
},
5052
">=5.6": {
51-
"index.d.ts": ["index.v5.6.d.ts"]
53+
"index.d.ts": [
54+
"index.v5.6.d.ts"
55+
]
5256
}
5357
},
5458
"files": [
@@ -86,6 +90,7 @@
8690
"@babel/core": "^7.26.0",
8791
"@babel/plugin-transform-modules-commonjs": "^7.25.9",
8892
"@types/nightwatch": "^2.3.32",
93+
"@types/node": "^22.9.3",
8994
"babel-plugin-replace-import-extension": "^1.1.4",
9095
"browserslist": "^4.24.2",
9196
"concurrently": "^9.1.0",

src/index.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* ignore unused exports */
2+
// @ts-self-types="../index.v5.6.d.ts"
23

34
export { Float16Array, isFloat16Array } from "./Float16Array.mjs";
45
export { isTypedArray } from "./isTypedArray.mjs";

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,13 @@
588588
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.11.tgz#1d455ac0211549a8409d3cdb371cd55cc971e8dc"
589589
integrity sha512-KJ021B1nlQUBLopzZmPBVuGU9un7WJd/W4ya7Ih02B4Uwky5Nja0yGYav2EfYIk0RR2Q9oVhf60S2XR1BCWJ2g==
590590

591+
"@types/node@^22.9.3":
592+
version "22.9.3"
593+
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.9.3.tgz#08f3d64b3bc6d74b162d36f60213e8a6704ef2b4"
594+
integrity sha512-F3u1fs/fce3FFk+DAxbxc78DF8x0cY09RRL8GnXLmkJ1jvx3TtPdWoTT5/NiYfI5ASqXBmfqJi9dZ3gxMx4lzw==
595+
dependencies:
596+
undici-types "~6.19.8"
597+
591598
"@types/responselike@^1.0.0":
592599
version "1.0.0"
593600
resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29"
@@ -5446,6 +5453,11 @@ unbox-primitive@^1.0.2:
54465453
has-symbols "^1.0.3"
54475454
which-boxed-primitive "^1.0.2"
54485455

5456+
undici-types@~6.19.8:
5457+
version "6.19.8"
5458+
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02"
5459+
integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==
5460+
54495461
unicorn-magic@^0.1.0:
54505462
version "0.1.0"
54515463
resolved "https://registry.yarnpkg.com/unicorn-magic/-/unicorn-magic-0.1.0.tgz#1bb9a51c823aaf9d73a8bfcd3d1a23dde94b0ce4"

0 commit comments

Comments
 (0)