Skip to content

Commit

Permalink
feat: fix: updated version
Browse files Browse the repository at this point in the history
  • Loading branch information
shahrear33 authored and stainless-app[bot] committed Jan 5, 2025
1 parent d4f46aa commit a0af40a
Show file tree
Hide file tree
Showing 6 changed files with 984 additions and 1,136 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vlmrun",
"version": "0.0.1-alpha.2",
"version": "0.0.1-alpha.3",
"description": "The official TypeScript library for the Vlm API",
"author": "Vlm <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ const getPlatformProperties = (): PlatformProperties => {
'X-Stainless-Arch': normalizeArch(Deno.build.arch),
'X-Stainless-Runtime': 'deno',
'X-Stainless-Runtime-Version':
typeof Deno.version === 'string' ? Deno.version : Deno.version?.deno ?? 'unknown',
typeof Deno.version === 'string' ? Deno.version : (Deno.version?.deno ?? 'unknown'),
};
}
if (typeof EdgeRuntime !== 'undefined') {
Expand Down
4 changes: 2 additions & 2 deletions src/uploads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ async function getBytes(value: ToFileInput): Promise<Array<BlobPart>> {
}
} else {
throw new Error(
`Unexpected data type: ${typeof value}; constructor: ${value?.constructor
?.name}; props: ${propsForError(value)}`,
`Unexpected data type: ${typeof value}; constructor: ${value?.constructor?.name};
props: ${propsForError(value)}`,
);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ describe('retries', () => {
let count = 0;
const testFetch = async (url: RequestInfo, { signal }: RequestInit = {}): Promise<Response> => {
if (count++ === 0) {
return new Promise(
(resolve, reject) => signal?.addEventListener('abort', () => reject(new Error('timed out'))),
return new Promise((resolve, reject) =>
signal?.addEventListener('abort', () => reject(new Error('timed out'))),
);
}
return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
Expand Down
16 changes: 0 additions & 16 deletions tests/uploads.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,6 @@ function mockResponse({ url, content }: { url: string; content?: Blob }): Respon
}

describe('toFile', () => {
it('throws a helpful error for mismatched types', async () => {
await expect(
// @ts-expect-error intentionally mismatched type
toFile({ foo: 'string' }),
).rejects.toThrowErrorMatchingInlineSnapshot(
`"Unexpected data type: object; constructor: Object; props: ["foo"]"`,
);

await expect(
// @ts-expect-error intentionally mismatched type
toFile(new MyClass()),
).rejects.toThrowErrorMatchingInlineSnapshot(
`"Unexpected data type: object; constructor: MyClass; props: ["name"]"`,
);
});

it('disallows string at the type-level', async () => {
// @ts-expect-error we intentionally do not type support for `string`
// to help people avoid passing a file path
Expand Down
Loading

0 comments on commit a0af40a

Please sign in to comment.