File tree Expand file tree Collapse file tree 5 files changed +18
-12
lines changed Expand file tree Collapse file tree 5 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export default tseslint.config(
52
52
"macos" ,
53
53
"rmapi" ,
54
54
"subfiles" ,
55
+ "uint" ,
55
56
"urls" ,
56
57
"webcrypto" ,
57
58
] ,
Original file line number Diff line number Diff line change 32
32
"uuid" : " ^11.1.0"
33
33
},
34
34
"devDependencies" : {
35
- "@eslint/js" : " ^9.26 .0" ,
36
- "@types/bun" : " ^1.2.11 " ,
35
+ "@eslint/js" : " ^9.33 .0" ,
36
+ "@types/bun" : " ^1.2.20 " ,
37
37
"@types/json-stable-stringify" : " ^1.2.0" ,
38
38
"@types/uuid" : " ^10.0.0" ,
39
- "@typescript-eslint/eslint-plugin" : " ^8.31 .1" ,
40
- "eslint" : " ^9.26 .0" ,
41
- "eslint-config-prettier" : " ^10.1.2 " ,
39
+ "@typescript-eslint/eslint-plugin" : " ^8.39 .1" ,
40
+ "eslint" : " ^9.33 .0" ,
41
+ "eslint-config-prettier" : " ^10.1.8 " ,
42
42
"eslint-plugin-spellcheck" : " ^0.0.20" ,
43
43
"eslint-plugin-tsdoc" : " ^0.4.0" ,
44
- "prettier" : " ^3.5.3 " ,
45
- "prettier-plugin-organize-imports" : " ^4.1 .0" ,
46
- "typedoc" : " ^0.28.4 " ,
47
- "typescript" : " ~5.8.3 " ,
48
- "typescript-eslint" : " ^8.31 .1"
44
+ "prettier" : " ^3.6.2 " ,
45
+ "prettier-plugin-organize-imports" : " ^4.2 .0" ,
46
+ "typedoc" : " ^0.28.10 " ,
47
+ "typescript" : " ~5.9.2 " ,
48
+ "typescript-eslint" : " ^8.39 .1"
49
49
}
50
50
}
Original file line number Diff line number Diff line change @@ -790,7 +790,8 @@ class Remarkable implements RemarkableApi {
790
790
Authorization : `Bearer ${ this . #userToken} ` ,
791
791
...headers ,
792
792
} ,
793
- body,
793
+ // fetch works correctly with uint8 arrays, but is not hinted correctly
794
+ body : body as unknown as ArrayBuffer ,
794
795
} ) ;
795
796
if ( ! resp . ok ) {
796
797
const msg = await resp . text ( ) ;
Original file line number Diff line number Diff line change @@ -653,7 +653,11 @@ const rootHash = properties(
653
653
) satisfies CompiledSchema < RootHash , unknown > ;
654
654
655
655
async function digest ( buff : Uint8Array ) : Promise < string > {
656
- const digest = await crypto . subtle . digest ( "SHA-256" , buff ) ;
656
+ const digest = await crypto . subtle . digest (
657
+ "SHA-256" ,
658
+ // NOTE this is type hinted wrong, but it does work correctly on a uint8 view
659
+ buff as unknown as ArrayBuffer ,
660
+ ) ;
657
661
return [ ...new Uint8Array ( digest ) ]
658
662
. map ( ( x ) => x . toString ( 16 ) . padStart ( 2 , "0" ) )
659
663
. join ( "" ) ;
You can’t perform that action at this time.
0 commit comments