Skip to content

Commit

Permalink
refactor: used triple equal sign
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Jan 9, 2022
1 parent ab53ac1 commit 1b93070
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/interceptors/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function defaultRequestInterceptor(axios: AxiosCacheInstance) {
let cache = await axios.storage.get(key);

// Not cached, continue the request, and mark it as fetching
emptyOrStale: if (cache.state == 'empty' || cache.state === 'stale') {
emptyOrStale: if (cache.state === 'empty' || cache.state === 'stale') {
/**
* This checks for simultaneous access to a new key. The js event loop jumps on the
* first await statement, so the second (asynchronous call) request may have already
Expand Down
6 changes: 3 additions & 3 deletions test/util/cache-predicate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ describe('tests cache predicate object', () => {
});

const headerExists = isCachePredicateValid(response, {
containsHeaders: { 'content-type': (header) => header == 'application/json' }
containsHeaders: { 'content-type': (header) => header === 'application/json' }
});

const isXmlContent = isCachePredicateValid(response, {
containsHeaders: { 'Content-Type': (header) => header == 'application/xml' }
containsHeaders: { 'Content-Type': (header) => header === 'application/xml' }
});

const isJsonContent = isCachePredicateValid(response, {
containsHeaders: { 'Content-Type': (header) => header == 'application/json' }
containsHeaders: { 'Content-Type': (header) => header === 'application/json' }
});

expect(headerExists).toBeFalsy();
Expand Down

0 comments on commit 1b93070

Please sign in to comment.