refactor: used triple equal sign

This commit is contained in:
arthurfiorette 2022-01-09 13:33:44 -03:00
parent ab53ac13dd
commit 1b93070db4
No known key found for this signature in database
GPG Key ID: 9D190CD53C53C555
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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();