Commit 62c67ae
committed
pg-cloudflare: Workaround typescript bug regarding Buffer.from
Fixes the following error:
% yarn build
yarn run v1.22.19
$ tsc --build
packages/pg-cloudflare/src/index.ts:156:29 - error TS2769: No overload matches this call.
The last overload gave the following error.
Argument of type 'ArrayBuffer | Uint8Array<ArrayBufferLike>' is not assignable to parameter of type 'WithImplicitCoercion<string> | { [Symbol.toPrimitive](hint: "string"): string; }'.
Type 'ArrayBuffer' is not assignable to type 'WithImplicitCoercion<string> | { [Symbol.toPrimitive](hint: "string"): string; }'.
156 const hex = Buffer.from(data).toString('hex')
~~~~
node_modules/@types/node/buffer.buffer.d.ts:83:13
83 from(
~~~~~
84 str:
~~~~~~~~~~~~~~~~~~~~
...
89 encoding?: BufferEncoding,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
90 ): Buffer<ArrayBuffer>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The last overload is declared here.
Found 1 error.
See microsoft/TypeScript#63447 for more info1 parent 695a7c6 commit 62c67ae
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
| |||
0 commit comments