File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,13 +36,13 @@ export class AppError extends Error {
3636 return correctField || e instanceof AppError ;
3737 }
3838
39- static getAppError ( e : any ) : AppError {
39+ static getAppError ( e : unknown ) : AppError {
4040 const wrappedError = AppError . getTypedError ( e ) ;
4141 if ( AppError . isAppError ( wrappedError ) ) return wrappedError ;
4242 return new AppError ( { code : "UNKNOWN_ERROR" , originalError : wrappedError } ) ;
4343 }
4444
45- private static getTypedError ( value : any ) : TypedError {
45+ private static getTypedError ( value : unknown ) : TypedError {
4646 if ( typeof value === "object" && value !== null ) {
4747 return value ;
4848 }
@@ -56,7 +56,7 @@ export class AppError extends Error {
5656 ...Object . getOwnPropertySymbols ( err ) ,
5757 ] ;
5858
59- const serializedObj = allProps . reduce < Record < string | symbol , any > > (
59+ const serializedObj = allProps . reduce < Record < string | symbol , unknown > > (
6060 ( acc , key ) => {
6161 if ( ! omit ?. [ key ] ) {
6262 const value = err [ key as keyof TypedError ] ;
Original file line number Diff line number Diff line change 11import { setTimeout } from "node:timers/promises" ;
22
33export const json_stringify = (
4- o : any ,
4+ o : unknown ,
55 space ?: number ,
66 allowDuplicates = false ,
77) => {
@@ -29,7 +29,9 @@ export const json_stringify = (
2929 return r ;
3030} ;
3131
32- export type PartialRecord < K extends keyof any , T > = { [ P in K ] ?: T } ;
32+ export type PartialRecord < K extends string | number | symbol , V > = Partial <
33+ Record < K , V >
34+ > ;
3335
3436export async function timeout ( ms : number ) : Promise < never > {
3537 await setTimeout ( ms ) ;
You can’t perform that action at this time.
0 commit comments