refactor: prefer unknown instead of any

This commit is contained in:
arthurfiorette 2022-01-09 17:31:28 -03:00
parent 38a5ecd365
commit d0b0e2fb6c
No known key found for this signature in database
GPG Key ID: 9D190CD53C53C555
2 changed files with 4 additions and 4 deletions

2
src/cache/cache.ts vendored
View File

@ -10,7 +10,7 @@ import type { CacheAxiosResponse, CacheRequestConfig } from './axios';
* @template R The type returned by this response
* @template D The type for the request body
*/
export type CacheProperties<R = any, D = any> = {
export type CacheProperties<R = unknown, D = unknown> = {
/**
* The time until the cached value is expired in milliseconds.
*

View File

@ -5,12 +5,12 @@ import type {
StorageValue
} from '../storage/types';
export type CachePredicate<R = any, D = any> = Exclude<
export type CachePredicate<R = unknown, D = unknown> = Exclude<
CachePredicateObject<R, D> | CachePredicateObject<R, D>['responseMatch'],
undefined
>;
export type CachePredicateObject<R = any, D = any> = {
export type CachePredicateObject<R = unknown, D = unknown> = {
/** Matches if this function returned true. */
statusCheck?: (status: number) => boolean;
@ -29,7 +29,7 @@ export type CachePredicateObject<R = any, D = any> = {
};
/** A simple function that receives a cache request config and should return a string id for it. */
export type KeyGenerator = <R = any, D = any>(
export type KeyGenerator = <R = unknown, D = unknown>(
options: CacheRequestConfig<R, D>
) => string;