Better Typing and Optimizations
This commit is contained in:
@@ -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;
|
||||
@@ -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>;
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import { createCheckers } from 'ts-interface-checker';
|
||||
import HttpError from './httpError.model-ti';
|
||||
|
||||
const HttpErrorChecker = createCheckers(HttpError)['HttpError'];
|
||||
export default HttpErrorChecker;
|
||||
Reference in New Issue
Block a user