Skip to content

Commit

Permalink
docs: fixed baseURL casing in examples & documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Jan 8, 2022
1 parent 75ec6fd commit 85336da
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/pages/global-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ See more about storages [here](pages/storages).
## `generateKey`

The function used to create different keys for each request. Defaults to a function that
priorizes the id, and if not specified, a string is generated using the method, baseUrl,
params, and url.
priorizes the id, and if not specified, a string is generated using the `method`,
`baseURL`, `params`, and `url`.

## `waiting`

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/request-id.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A good thing to know is that every request passed through this interceptor, has
most important is to bind a request to its cache.

The id generation is good enough to generate the same id for theoretically sames requests.
The example of this is a request with `{ baseUrl: 'https://a.com/', url: '/b' }` results
The example of this is a request with `{ baseURL: 'https://a.com/', url: '/b' }` results
to the same id with `{ url: 'https://a.com/b/' }`.

Also, a custom id can be used to treat two requests as the same.
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/try-it-out.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ const { setupCache, buildWebStorage } = require('axios-cache-interceptor');
const axios = Axios.create({});
setupCache(axios, {});

await axios.get('https://jsonplaceholder.typicode.com/posts/1');
const result = await axios.get('https://jsonplaceholder.typicode.com/posts/1');
```
8 changes: 4 additions & 4 deletions test/util/key-generator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ describe('tests key generation', () => {
params
});

const keyWithBaseUrl = defaultKeyGenerator({
const keyWithBaseURL = defaultKeyGenerator({
baseURL: 'http://example.com/asd/test',
method,
params
});

const keyWithUrl = defaultKeyGenerator({
const keyWithURL = defaultKeyGenerator({
url: 'http://example.com/asd/test',
method,
params
});

expect(keyWithBoth).toEqual(keyWithBaseUrl);
expect(keyWithBoth).toEqual(keyWithUrl);
expect(keyWithBoth).toEqual(keyWithBaseURL);
expect(keyWithBoth).toEqual(keyWithURL);
});

it('tests against trailing slashes', () => {
Expand Down

0 comments on commit 85336da

Please sign in to comment.