Skip to content

Commit 0db4909

Browse files
authored
[Core-client] Update the stream check in serializer (Azure#13923)
We've moved from `() => NodeJS.ReadableStream` to `NodeJS.ReadableStream` in `RequestBodyType`. This change updates the condition for this case.
1 parent eafa579 commit 0db4909

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdk/core/core-client/src/serializer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,13 @@ function serializeBasicTypes(typeName: string, objectName: string, value: any):
430430
const objectType = typeof value;
431431
if (
432432
objectType !== "string" &&
433-
objectType !== "function" &&
433+
typeof value.pipe !== "function" &&
434434
!(value instanceof ArrayBuffer) &&
435435
!ArrayBuffer.isView(value) &&
436436
!(value?.constructor?.name === "Blob")
437437
) {
438438
throw new Error(
439-
`${objectName} must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream.`
439+
`${objectName} must be a string, Blob, ArrayBuffer, ArrayBufferView, or NodeJS.ReadableStream.`
440440
);
441441
}
442442
}

0 commit comments

Comments
 (0)