fix: lock and format

This commit is contained in:
Artemy
2024-05-12 16:28:25 +03:00
parent 30977d1357
commit 593b4cde4a
14 changed files with 93 additions and 93 deletions

View File

@ -1,13 +1,13 @@
import Route from "route-parser";
import Route from 'route-parser';
import {
HandlerInput,
IHandlerOutput,
EngineFunction,
RouteValues,
} from "./types/handler";
} from './types/handler';
import { NoHandlerFoundError } from "./types/errors";
import { NoHandlerFoundError } from './types/errors';
interface IRoute<TParams extends RouteValues> {
route: Route;

View File

@ -1,3 +1,3 @@
import { Engine } from "./engine";
import { Engine } from './engine';
export { Engine };

View File

@ -13,12 +13,12 @@ export abstract class TxtDotError extends Error {
export class NoHandlerFoundError extends TxtDotError {
constructor(message: string) {
super(404, "NoHandlerFoundError", `No handler found for: ${message}`);
super(404, 'NoHandlerFoundError', `No handler found for: ${message}`);
}
}
export class EngineParseError extends TxtDotError {
constructor(message: string) {
super(422, "EngineParseError", `Parse error: ${message}`);
super(422, 'EngineParseError', `Parse error: ${message}`);
}
}

View File

@ -1,5 +1,5 @@
import { parseHTML } from "linkedom";
import { Engine } from "../engine";
import { parseHTML } from 'linkedom';
import { Engine } from '../engine';
export class HandlerInput {
private data: string;
@ -33,19 +33,19 @@ export interface IHandlerOutput {
}
export const handlerSchema = {
type: "object",
type: 'object',
properties: {
content: {
type: "string",
type: 'string',
},
textContent: {
type: "string",
type: 'string',
},
title: {
type: "string",
type: 'string',
},
lang: {
type: "string",
type: 'string',
},
},
};