From fbf33584daf063e75d6f4c308b59083ff1710a57 Mon Sep 17 00:00:00 2001 From: efstajas Date: Sun, 26 Apr 2020 12:53:38 +0200 Subject: [PATCH] cleanup: ensure-everything-is-named-like-this.ts (#7) * ensure-everything-is-named-like-this.ts * fix imports --- src/call-app-method.ts | 2 +- .../error-templates/handler-not-function.ts} | 0 .../error-templates/hook-not-function.ts} | 0 .../error-templates/hooks-not-object.ts} | 0 .../error-templates/missing-method.ts} | 0 .../validateApp.ts => app-validator/validate-app.ts} | 8 ++++---- src/methods/{buildCanvas.ts => build-canvas.ts} | 0 src/tela.class.ts | 2 +- 8 files changed, 6 insertions(+), 6 deletions(-) rename src/methods/{appValidator/errorTemplates/handlerNotFunction.ts => app-validator/error-templates/handler-not-function.ts} (100%) rename src/methods/{appValidator/errorTemplates/hookNotFunction.ts => app-validator/error-templates/hook-not-function.ts} (100%) rename src/methods/{appValidator/errorTemplates/hooksNotObject.ts => app-validator/error-templates/hooks-not-object.ts} (100%) rename src/methods/{appValidator/errorTemplates/missingMethod.ts => app-validator/error-templates/missing-method.ts} (100%) rename src/methods/{appValidator/validateApp.ts => app-validator/validate-app.ts} (80%) rename src/methods/{buildCanvas.ts => build-canvas.ts} (100%) diff --git a/src/call-app-method.ts b/src/call-app-method.ts index 209e5d4..e1a25fe 100644 --- a/src/call-app-method.ts +++ b/src/call-app-method.ts @@ -1,5 +1,5 @@ import { Request, Response, NextFunction } from 'express' -import buildCanvas from './methods/buildCanvas' +import buildCanvas from './methods/build-canvas' import constructHandlerContext from './methods/construct-handler-context' import { CanvasHandler, App } from './app.types' diff --git a/src/methods/appValidator/errorTemplates/handlerNotFunction.ts b/src/methods/app-validator/error-templates/handler-not-function.ts similarity index 100% rename from src/methods/appValidator/errorTemplates/handlerNotFunction.ts rename to src/methods/app-validator/error-templates/handler-not-function.ts diff --git a/src/methods/appValidator/errorTemplates/hookNotFunction.ts b/src/methods/app-validator/error-templates/hook-not-function.ts similarity index 100% rename from src/methods/appValidator/errorTemplates/hookNotFunction.ts rename to src/methods/app-validator/error-templates/hook-not-function.ts diff --git a/src/methods/appValidator/errorTemplates/hooksNotObject.ts b/src/methods/app-validator/error-templates/hooks-not-object.ts similarity index 100% rename from src/methods/appValidator/errorTemplates/hooksNotObject.ts rename to src/methods/app-validator/error-templates/hooks-not-object.ts diff --git a/src/methods/appValidator/errorTemplates/missingMethod.ts b/src/methods/app-validator/error-templates/missing-method.ts similarity index 100% rename from src/methods/appValidator/errorTemplates/missingMethod.ts rename to src/methods/app-validator/error-templates/missing-method.ts diff --git a/src/methods/appValidator/validateApp.ts b/src/methods/app-validator/validate-app.ts similarity index 80% rename from src/methods/appValidator/validateApp.ts rename to src/methods/app-validator/validate-app.ts index c00d749..e13a0b4 100644 --- a/src/methods/appValidator/validateApp.ts +++ b/src/methods/app-validator/validate-app.ts @@ -1,8 +1,8 @@ import { App } from '../../app.types' -import missingMethodTemplate from './errorTemplates/missingMethod' -import hooksNotObjectTemplate from './errorTemplates/hooksNotObject' -import handlerNotFunctionTemplate from './errorTemplates/handlerNotFunction' -import hookNotFunctionTemplate from './errorTemplates/hookNotFunction' +import missingMethodTemplate from './error-templates/missing-method' +import hooksNotObjectTemplate from './error-templates/hooks-not-object' +import handlerNotFunctionTemplate from './error-templates/handler-not-function' +import hookNotFunctionTemplate from './error-templates/hook-not-function' export default (appName: string, app: App) => { const requiredMembers = ['initialize'] diff --git a/src/methods/buildCanvas.ts b/src/methods/build-canvas.ts similarity index 100% rename from src/methods/buildCanvas.ts rename to src/methods/build-canvas.ts diff --git a/src/tela.class.ts b/src/tela.class.ts index 92ce5ef..bea1933 100644 --- a/src/tela.class.ts +++ b/src/tela.class.ts @@ -4,7 +4,7 @@ import * as bodyParser from 'body-parser' import { App } from './app.types' import constructHandlerContext from './methods/construct-handler-context' import constructRouter from './methods/construct-router' -import validateApp from './methods/appValidator/validateApp' +import validateApp from './methods/app-validator/validate-app' export default class Tela { private server = express().use(bodyParser.json());