Skip to content

Commit 003590c

Browse files
committed
Fix linting errors
1 parent 86feeab commit 003590c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ declare module 'replicate' {
6969

7070
export type Training = Prediction;
7171

72-
interface Page<T> {
72+
export interface Page<T> {
7373
previous?: string;
7474
next?: string;
7575
results: T[];
@@ -80,13 +80,13 @@ declare module 'replicate' {
8080
auth?: string;
8181
userAgent?: string;
8282
baseUrl?: string;
83-
fetch?: Function;
83+
fetch?: (input: Request | string, init?: RequestInit) => Promise<Response>
8484
});
8585

8686
auth: string;
8787
userAgent?: string;
8888
baseUrl?: string;
89-
fetch: Function;
89+
fetch: (input: Request | string, init?: RequestInit) => Promise<Response>
9090

9191
run(
9292
identifier: `${string}/${string}` | `${string}/${string}:${string}`,

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ class Replicate {
188188
data,
189189
} = options;
190190

191-
Object.entries(params).forEach(([key, value]) => {
191+
for (const [key, value] of Object.entries(params)) {
192192
url.searchParams.append(key, value);
193-
});
193+
}
194194

195195
const headers = new Headers();
196196
if (auth) {
@@ -199,9 +199,9 @@ class Replicate {
199199
headers.append('Content-Type', 'application/json');
200200
headers.append('User-Agent', userAgent);
201201
if (options.headers) {
202-
options.headers.forEach((value, key) => {
202+
for (const [key, value] of options.headers.entries()) {
203203
headers.append(key, value);
204-
});
204+
}
205205
}
206206

207207
const init = {

index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const BASE_URL = 'https://api.replicate.com/v1';
99
nock.disableNetConnect();
1010

1111
describe('Replicate client', () => {
12-
let unmatched: Object[] = [];
12+
let unmatched: any[] = [];
1313
const handleNoMatch = (req: unknown, options: any, body: string) =>
1414
unmatched.push({ req, options, body });
1515

0 commit comments

Comments
 (0)