From 4f5a2bb5e958dd130d60a9167d4a1edaa29b21b2 Mon Sep 17 00:00:00 2001 From: titanism <101466223+titanism@users.noreply.github.com> Date: Thu, 25 Jan 2024 19:03:56 -0600 Subject: [PATCH] fix: removed validator and url usage --- package.json | 1 - src/koa.ts | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index 01c3ba6..2de5e1f 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "path-to-regexp": "^6.2.1", "raw-body": "^2.5.2", "rrule": "^2.8.1", - "validator": "^13.11.0", "winston": "^3.11.0", "xmlbuilder2": "^3.1.1", "xmldom": "^0.6.0", diff --git a/src/koa.ts b/src/koa.ts index 84008e7..e1ca30a 100644 --- a/src/koa.ts +++ b/src/koa.ts @@ -6,7 +6,6 @@ import parseBody from './common/parseBody'; import winston from './common/winston'; import cal from './routes/calendar/calendar'; import pri from './routes/principal/principal'; -import { isURL } from 'validator'; import { Request, ParameterizedContext } from 'koa'; import { FullCalendar } from 'ical'; @@ -45,7 +44,7 @@ export default function(opts: CalDavOptions) { const log = winston({ ...opts, label: 'index' }); - const rootRoute = isURL(opts.caldavRoot) ? path.join(opts.caldavRoot, '/') : path.join('/', opts.caldavRoot); + const rootRoute = path.join('/', opts.caldavRoot); const calendarRoute = path.join(rootRoute, opts.calendarRoot); const principalRoute = path.join(rootRoute, opts.principalRoot, '/');