Better Typing and Optimizations

This commit is contained in:
2023-12-29 07:03:08 -03:00
parent 83fd8f0f2c
commit 567308ebfb
21 changed files with 105 additions and 145 deletions

View File

@@ -1,18 +0,0 @@
/**
* This module was automatically generated by `ts-interface-builder`
*/
import * as t from 'ts-interface-checker';
// tslint:disable:object-literal-key-quotes
export const HttpError = t.iface([], {
title: 'string',
status: 'number',
details: 'string',
developerMessage: 'string',
timestamp: 'string',
});
const exportedTypeSuite: t.ITypeSuite = {
HttpError,
};
export default exportedTypeSuite;

View File

@@ -1,7 +1,12 @@
export interface HttpError {
title: string;
status: number;
details: string;
developerMessage: string;
timestamp: string;
}
import { Type, type Static } from '@sinclair/typebox'
export const HttpError = Type.Object({
title: Type.String(),
status: Type.Number(),
details: Type.String(),
developerMessage: Type.String(),
timestamp: Type.String()
});
export type HttpError = Static<typeof HttpError>;

View File

@@ -1,5 +0,0 @@
import { createCheckers } from 'ts-interface-checker';
import HttpError from './httpError.model-ti';
const HttpErrorChecker = createCheckers(HttpError)['HttpError'];
export default HttpErrorChecker;