Skip to content

Commit

Permalink
chore: remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pmbanugo committed Jul 19, 2022
1 parent 6c90fff commit f3c66ec
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
5 changes: 1 addition & 4 deletions packages/micro/src/bin/micro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ if ((args['--port'] || args['--host']) && args['--unix-socket']) {
process.exit(1);
}

// TODO: remove the deprecated endpoints support with a major release
// TODO: consider removing the deprecated endpoints support with a major release?
const deprecatedEndpoint: string[] = [];

args['--listen'] = args['--listen'] || [];
Expand Down Expand Up @@ -152,9 +152,6 @@ let file = args._[0];

if (!file) {
try {
// const packageJson = require(path.resolve(process.cwd(), 'package.json'));
// file = packageJson.main || 'index.js';

const req = Module.createRequire(module.filename);
const packageJson: unknown = req(
path.resolve(process.cwd(), 'package.json'),
Expand Down
7 changes: 0 additions & 7 deletions packages/micro/src/lib/handler.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
// import { dynamicImport } from 'tsimportlib';
// import { dynamicImport } from './importlib';
// Utilities
import { logError } from './error';
// import type { MinimalNodeModule } from 'tsimportlib';
// import type { MinimalNodeModule } from './importlib';

export const handle = async (file: string) => {
let mod: unknown;

try {
//TODO: remove dynamicImport
// mod = await dynamicImport(file, module as MinimalNodeModule);

mod = file.endsWith('.mjs') ? await import(file) : await require(file); // Await to support exporting Promises

if (mod && typeof mod === 'object') {
Expand Down
2 changes: 1 addition & 1 deletion packages/micro/types/src/lib/handler.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f3c66ec

Please sign in to comment.