Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2025-03-07 14:12:24 +01:00
parent 9cfc09a0be
commit 7828186c11
2 changed files with 10 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs-backend': patch
---
Minor type fix
+5 -1
View File
@@ -58,7 +58,11 @@ export const createCacheMiddleware = ({
encoding?: BufferEncoding | ErrorCallback,
callback?: ErrorCallback,
) => {
chunks.push(Buffer.from(data));
// This cast is obviously weird, but it covers a type bug in @types/node
// which does not gracefully handle union types.
chunks.push(
typeof data === 'string' ? Buffer.from(data) : Buffer.from(data),
);
if (typeof encoding === 'function') {
return realWrite(data, encoding);
}