Skip to content

Commit

Permalink
updates: reduce bundle size&integrate [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
abschill committed Jun 17, 2022
1 parent 7fbe8ea commit bf01d3d
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 52 deletions.
6 changes: 3 additions & 3 deletions docs/typedoc/interfaces/useServer.HTTPuppyRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

#### Defined in

[src/server.ts:54](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L54)
[src/server.ts:54](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L54)

___

Expand All @@ -95,7 +95,7 @@ ___

#### Defined in

[src/server.ts:55](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L55)
[src/server.ts:55](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L55)

___

Expand Down Expand Up @@ -126,7 +126,7 @@ ___

#### Defined in

[src/server.ts:53](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L53)
[src/server.ts:53](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L53)

___

Expand Down
6 changes: 3 additions & 3 deletions docs/typedoc/interfaces/useServer.HTTPuppyResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

#### Defined in

[src/server.ts:58](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L58)
[src/server.ts:58](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L58)

___

Expand Down Expand Up @@ -1352,7 +1352,7 @@ ___

#### Defined in

[src/server.ts:60](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L60)
[src/server.ts:60](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L60)

___

Expand Down Expand Up @@ -2371,7 +2371,7 @@ ___

#### Defined in

[src/server.ts:59](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L59)
[src/server.ts:59](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L59)

___

Expand Down
14 changes: 7 additions & 7 deletions docs/typedoc/interfaces/useServer.HTTPuppyServer.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

#### Defined in

[src/server.ts:50](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L50)
[src/server.ts:50](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L50)

___

Expand All @@ -78,7 +78,7 @@ ___

#### Defined in

[src/server.ts:49](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L49)
[src/server.ts:49](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L49)

___

Expand All @@ -102,7 +102,7 @@ ___

#### Defined in

[src/server.ts:45](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L45)
[src/server.ts:45](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L45)

___

Expand Down Expand Up @@ -252,7 +252,7 @@ ___

#### Defined in

[src/server.ts:46](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L46)
[src/server.ts:46](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L46)

___

Expand All @@ -262,7 +262,7 @@ ___

#### Defined in

[src/server.ts:44](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L44)
[src/server.ts:44](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L44)

___

Expand Down Expand Up @@ -2546,7 +2546,7 @@ ___

#### Defined in

[src/server.ts:47](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L47)
[src/server.ts:47](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L47)

___

Expand All @@ -2560,7 +2560,7 @@ ___

#### Defined in

[src/server.ts:48](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L48)
[src/server.ts:48](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L48)

___

Expand Down
30 changes: 15 additions & 15 deletions docs/typedoc/interfaces/useServer.HTTPuppyServerOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

#### Defined in

[src/server.ts:105](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L105)
[src/server.ts:105](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L105)

___

Expand All @@ -70,7 +70,7 @@ ___

#### Defined in

[src/server.ts:97](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L97)
[src/server.ts:97](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L97)

___

Expand All @@ -80,7 +80,7 @@ ___

#### Defined in

[src/server.ts:106](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L106)
[src/server.ts:106](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L106)

___

Expand All @@ -90,7 +90,7 @@ ___

#### Defined in

[src/server.ts:98](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L98)
[src/server.ts:98](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L98)

___

Expand All @@ -100,7 +100,7 @@ ___

#### Defined in

[src/server.ts:101](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L101)
[src/server.ts:101](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L101)

___

Expand All @@ -110,7 +110,7 @@ ___

#### Defined in

[src/server.ts:102](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L102)
[src/server.ts:102](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L102)

___

Expand All @@ -120,7 +120,7 @@ ___

#### Defined in

[src/server.ts:104](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L104)
[src/server.ts:104](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L104)

___

Expand All @@ -130,7 +130,7 @@ ___

#### Defined in

[src/server.ts:103](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L103)
[src/server.ts:103](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L103)

___

Expand All @@ -140,7 +140,7 @@ ___

#### Defined in

[src/server.ts:96](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L96)
[src/server.ts:96](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L96)

___

Expand All @@ -150,7 +150,7 @@ ___

#### Defined in

[src/server.ts:107](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L107)
[src/server.ts:107](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L107)

___

Expand All @@ -168,7 +168,7 @@ ___

#### Defined in

[src/server.ts:108](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L108)
[src/server.ts:108](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L108)

___

Expand All @@ -178,7 +178,7 @@ ___

#### Defined in

[src/server.ts:99](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L99)
[src/server.ts:99](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L99)

___

Expand All @@ -188,7 +188,7 @@ ___

#### Defined in

[src/server.ts:100](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L100)
[src/server.ts:100](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L100)

___

Expand All @@ -198,7 +198,7 @@ ___

#### Defined in

[src/server.ts:113](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L113)
[src/server.ts:113](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L113)

___

Expand All @@ -208,4 +208,4 @@ ___

#### Defined in

[src/server.ts:114](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L114)
[src/server.ts:114](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L114)
4 changes: 2 additions & 2 deletions docs/typedoc/modules/useRouter.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#### Defined in

[src/router.ts:52](https://github.com/abschill/httpuppy/blob/1c77fbb/src/router.ts#L52)
[src/router.ts:52](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/router.ts#L52)

## Functions

Expand Down Expand Up @@ -59,4 +59,4 @@ router.get('/test', (req, res) => res.end('hello'));

#### Defined in

[src/router.ts:123](https://github.com/abschill/httpuppy/blob/1c77fbb/src/router.ts#L123)
[src/router.ts:123](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/router.ts#L123)
12 changes: 6 additions & 6 deletions docs/typedoc/modules/useServer.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

#### Defined in

[src/server.ts:72](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L72)
[src/server.ts:72](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L72)

___

Expand All @@ -63,7 +63,7 @@ ___

#### Defined in

[src/server.ts:77](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L77)
[src/server.ts:77](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L77)

___

Expand All @@ -82,7 +82,7 @@ ___

#### Defined in

[src/server.ts:62](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L62)
[src/server.ts:62](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L62)

## Variables

Expand All @@ -92,7 +92,7 @@ ___

#### Defined in

[src/server.ts:117](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L117)
[src/server.ts:117](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L117)

## Functions

Expand All @@ -112,7 +112,7 @@ ___

#### Defined in

[src/server.ts:129](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L129)
[src/server.ts:129](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L129)

___

Expand Down Expand Up @@ -145,4 +145,4 @@ httpuppy server

#### Defined in

[src/server.ts:151](https://github.com/abschill/httpuppy/blob/1c77fbb/src/server.ts#L151)
[src/server.ts:151](https://github.com/abschill/httpuppy/blob/7fbe8ea/src/server.ts#L151)
17 changes: 1 addition & 16 deletions test/internal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import { join, resolve } from 'path';
import {
isValidStats,
useEntityTag,
checkNumConfigs,
mimeType,
useConfigFrom
mimeType
} from '../lib/internal';

const fixtures = join(process.cwd(), '__fixtures__');
Expand All @@ -28,12 +26,6 @@ describe('test etag generation process', () => {
});
});

describe('misc internal testing', () => {
it('finds the right number of configs in figures', () => {
expect(checkNumConfigs(fixtures)).toBe(2);
});
});

describe('localized mime types', () => {
it('detects the html file in fixtures', () => {
expect(mimeType(resolve(fixtures, 'index.html'))).toEqual({'Content-Type': 'text/html'});
Expand All @@ -43,10 +35,3 @@ describe('localized mime types', () => {
expect(mimeType(resolve(process.cwd(), 'examples', 'style.css'))).toEqual({'Content-Type': 'text/css'});
});
});

describe('config tests', () => {
it('loads config without prompt from local dir with only one option', () => {
const expected = require('../httpuppy.json');
expect(useConfigFrom(process.cwd())).toEqual(expected);
});
});

0 comments on commit bf01d3d

Please sign in to comment.