remove some unused code

This commit is contained in:
Rich Harris
2018-06-14 16:34:16 -04:00
parent be7cff4818
commit 9c4a3592ff

View File

@@ -1,15 +1,12 @@
import * as fs from 'fs';
import * as path from 'path';
import { resolve, URL } from 'url';
import { URL } from 'url';
import { ClientRequest, ServerResponse } from 'http';
import cookie from 'cookie';
import mkdirp from 'mkdirp';
import rimraf from 'rimraf';
import devalue from 'devalue';
import fetch from 'node-fetch';
import { lookup } from './middleware/mime';
import { locations, dev } from './config';
import { Route, Template } from './interfaces';
import sourceMapSupport from 'source-map-support';
sourceMapSupport.install();
@@ -139,8 +136,6 @@ function serve({ prefix, pathname, cache_control }: {
};
}
const resolved = Promise.resolve();
function get_route_handler(chunks: Record<string, string>, App: Component, routes: RouteObject[], store_getter: (req: Req) => Store) {
const template = dev()
? () => fs.readFileSync(`${locations.app()}/template.html`, 'utf-8')
@@ -451,10 +446,6 @@ function compose_handlers(handlers: Handler[]) {
};
}
function read_json(file: string) {
return JSON.parse(fs.readFileSync(file, 'utf-8'));
}
function try_serialize(data: any) {
try {
return devalue(data);