Skip to content

Commit 011013e

Browse files
chore: break long lines in snippets into multiline
1 parent 664a668 commit 011013e

File tree

4 files changed

+53
-11
lines changed

4 files changed

+53
-11
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,14 @@ await client.files.upload({ file: new File(['my bytes'], 'file'), fileName: 'fil
121121
await client.files.upload({ file: await fetch('https://somesite/file'), fileName: 'fileName' });
122122

123123
// Finally, if none of the above are convenient, you can use our `toFile` helper:
124-
await client.files.upload({ file: await toFile(Buffer.from('my bytes'), 'file'), fileName: 'fileName' });
125-
await client.files.upload({ file: await toFile(new Uint8Array([0, 1, 2]), 'file'), fileName: 'fileName' });
124+
await client.files.upload({
125+
file: await toFile(Buffer.from('my bytes'), 'file'),
126+
fileName: 'fileName',
127+
});
128+
await client.files.upload({
129+
file: await toFile(new Uint8Array([0, 1, 2]), 'file'),
130+
fileName: 'fileName',
131+
});
126132
```
127133

128134
## URL generation

tests/api-resources/beta/v2/files.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ describe('resource files', () => {
4444
semitransparency: true,
4545
},
4646
},
47-
{ maxTags: 5, minConfidence: 95, name: 'google-auto-tagging' },
47+
{
48+
maxTags: 5,
49+
minConfidence: 95,
50+
name: 'google-auto-tagging',
51+
},
4852
{ name: 'ai-auto-description' },
4953
],
5054
folder: 'folder',
@@ -59,7 +63,11 @@ describe('resource files', () => {
5963
transformation: {
6064
post: [
6165
{ type: 'thumbnail', value: 'w-150,h-150' },
62-
{ protocol: 'dash', type: 'abs', value: 'sr-240_360_480_720_1080' },
66+
{
67+
protocol: 'dash',
68+
type: 'abs',
69+
value: 'sr-240_360_480_720_1080',
70+
},
6371
],
6472
pre: 'w-300,h-300,q-80',
6573
},

tests/api-resources/files/files.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ describe('resource files', () => {
152152
semitransparency: true,
153153
},
154154
},
155-
{ maxTags: 5, minConfidence: 95, name: 'google-auto-tagging' },
155+
{
156+
maxTags: 5,
157+
minConfidence: 95,
158+
name: 'google-auto-tagging',
159+
},
156160
{ name: 'ai-auto-description' },
157161
],
158162
folder: 'folder',
@@ -169,7 +173,11 @@ describe('resource files', () => {
169173
transformation: {
170174
post: [
171175
{ type: 'thumbnail', value: 'w-150,h-150' },
172-
{ protocol: 'dash', type: 'abs', value: 'sr-240_360_480_720_1080' },
176+
{
177+
protocol: 'dash',
178+
type: 'abs',
179+
value: 'sr-240_360_480_720_1080',
180+
},
173181
],
174182
pre: 'w-300,h-300,q-80',
175183
},

tests/index.test.ts

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ describe('instantiate client', () => {
134134
};
135135

136136
process.env['IMAGE_KIT_LOG'] = 'debug';
137-
const client = new ImageKit({ logger: logger, privateKey: 'My Private Key', password: 'My Password' });
137+
const client = new ImageKit({
138+
logger: logger,
139+
privateKey: 'My Private Key',
140+
password: 'My Password',
141+
});
138142
expect(client.logLevel).toBe('debug');
139143

140144
await forceAPIResponseForClient(client);
@@ -151,7 +155,11 @@ describe('instantiate client', () => {
151155
};
152156

153157
process.env['IMAGE_KIT_LOG'] = 'not a log level';
154-
const client = new ImageKit({ logger: logger, privateKey: 'My Private Key', password: 'My Password' });
158+
const client = new ImageKit({
159+
logger: logger,
160+
privateKey: 'My Private Key',
161+
password: 'My Password',
162+
});
155163
expect(client.logLevel).toBe('warn');
156164
expect(warnMock).toHaveBeenCalledWith(
157165
'process.env[\'IMAGE_KIT_LOG\'] was set to "not a log level", expected one of ["off","error","warn","info","debug"]',
@@ -383,7 +391,11 @@ describe('instantiate client', () => {
383391
});
384392

385393
test('maxRetries option is correctly set', () => {
386-
const client = new ImageKit({ maxRetries: 4, privateKey: 'My Private Key', password: 'My Password' });
394+
const client = new ImageKit({
395+
maxRetries: 4,
396+
privateKey: 'My Private Key',
397+
password: 'My Password',
398+
});
387399
expect(client.maxRetries).toEqual(4);
388400

389401
// default
@@ -761,7 +773,11 @@ describe('retries', () => {
761773
return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
762774
};
763775

764-
const client = new ImageKit({ privateKey: 'My Private Key', password: 'My Password', fetch: testFetch });
776+
const client = new ImageKit({
777+
privateKey: 'My Private Key',
778+
password: 'My Password',
779+
fetch: testFetch,
780+
});
765781

766782
expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 });
767783
expect(count).toEqual(2);
@@ -791,7 +807,11 @@ describe('retries', () => {
791807
return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
792808
};
793809

794-
const client = new ImageKit({ privateKey: 'My Private Key', password: 'My Password', fetch: testFetch });
810+
const client = new ImageKit({
811+
privateKey: 'My Private Key',
812+
password: 'My Password',
813+
fetch: testFetch,
814+
});
795815

796816
expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 });
797817
expect(count).toEqual(2);

0 commit comments

Comments
 (0)