Skip to content

Commit 351020a

Browse files
committed
prefixUrl -> prefix
1 parent 913d104 commit 351020a

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,9 +570,9 @@ You can also refer to parent defaults by providing a function to `.extend()`.
570570
```js
571571
import ky from 'ky';
572572

573-
const api = ky.create({prefixUrl: 'https://example.com/api'});
573+
const api = ky.create({prefix: 'https://example.com/api'});
574574

575-
const usersApi = api.extend((options) => ({prefixUrl: `${options.prefixUrl}/users`}));
575+
const usersApi = api.extend((options) => ({prefix: `${options.prefix}/users`}));
576576

577577
const response = await usersApi.get('123');
578578
//=> 'https://example.com/api/users/123'

source/types/ky.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ export type KyInstance = {
8787
```
8888
import ky from 'ky';
8989
90-
const api = ky.create({prefixUrl: 'https://example.com/api'});
90+
const api = ky.create({prefix: 'https://example.com/api'});
9191
92-
const usersApi = api.extend((options) => ({prefixUrl: `${options.prefixUrl}/users`}));
92+
const usersApi = api.extend((options) => ({prefix: `${options.prefix}/users`}));
9393
9494
const response = await usersApi.get('123');
9595
//=> 'https://example.com/api/users/123'

test/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,8 @@ test('ky.extend() with function overrides primitives in parent defaults', async
611611
response.end(request.url);
612612
});
613613

614-
const api = ky.create({prefixUrl: `${server.url}/api`});
615-
const usersApi = api.extend(options => ({prefixUrl: `${options.prefixUrl!.toString()}/users`}));
614+
const api = ky.create({prefix: `${server.url}/api`});
615+
const usersApi = api.extend(options => ({prefix: `${options.prefix!.toString()}/users`}));
616616

617617
t.is(await usersApi.get('123').text(), '/api/users/123');
618618
t.is(await api.get('version').text(), '/api/version');
@@ -636,7 +636,7 @@ test('ky.extend() with function retains parent defaults when not specified', asy
636636
response.end(request.url);
637637
});
638638

639-
const api = ky.create({prefixUrl: `${server.url}/api`});
639+
const api = ky.create({prefix: `${server.url}/api`});
640640
const extendedApi = api.extend(() => ({}));
641641

642642
t.is(await api.get('version').text(), '/api/version');
File renamed without changes.

0 commit comments

Comments
 (0)