Skip to content

Commit

Permalink
refactor: prefer unknown instead of any
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Jan 9, 2022
1 parent 38a5ecd commit d0b0e2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cache/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
6 changes: 3 additions & 3 deletions src/util/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit d0b0e2f

Please sign in to comment.