mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-07 04:20:49 +00:00
ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.129.1
This commit is contained in:
30
src/types/blobs.ts
Normal file
30
src/types/blobs.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
import * as z from "zod";
|
||||
|
||||
export const blobLikeSchema = z.custom<Blob>(isBlobLike, {
|
||||
message: "expected a Blob, File or Blob-like object",
|
||||
fatal: true,
|
||||
});
|
||||
|
||||
export function isBlobLike(val: unknown): val is Blob {
|
||||
if (val instanceof Blob) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const name = val[Symbol.toStringTag];
|
||||
if (typeof name !== "string") {
|
||||
return false;
|
||||
}
|
||||
if (name !== "Blob" && name !== "File") {
|
||||
return false;
|
||||
}
|
||||
|
||||
return "stream" in val && typeof val.stream === "function";
|
||||
}
|
||||
Reference in New Issue
Block a user