Skip to content

Commit

Permalink
fix: change default export to named export
Browse files Browse the repository at this point in the history
  • Loading branch information
rvboris committed Sep 17, 2019
1 parent 03cedde commit acc3927
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ koa-useragent
```js
const koa = require('koa'),
const app = koa.app()
const userAgent = require('koa-useragent');
const { userAgent } = require('koa-useragent');

app.use(userAgent);

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Context } from 'koa';
import UserAgent from './lib/useragent';

export default async (ctx: Context, next: () => Promise<void>): Promise<void> => {
export const userAgent = async (ctx: Context, next: () => Promise<void>): Promise<void> => {
const { header } = ctx.request;
const source = header['user-agent'];

Expand Down
2 changes: 1 addition & 1 deletion test/koa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import test, { ExecutionContext } from 'ava';
import Koa, { Context } from 'koa';
import http from 'http';
import request from 'supertest';
import userAgent from '../src/index';
import { userAgent } from '../src/index';

test('koa middleware', async (t: ExecutionContext) => {
const app = new Koa();
Expand Down

0 comments on commit acc3927

Please sign in to comment.