Skip to content

Commit

Permalink
fix: expose parsers.array
Browse files Browse the repository at this point in the history
  • Loading branch information
yoursunny committed May 6, 2020
1 parent 0da7052 commit 998dbfc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
10 changes: 10 additions & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import * as parsers from './parsers';

import * as environment from '.';

describe('environment', () => {
Expand All @@ -11,5 +13,13 @@ describe('environment', () => {
Object.values(environment.parsers).forEach(parser => {
expect(typeof parser).toBe('function');
});

Object.entries(parsers).forEach(([name, parser]) => {
if (typeof parser === 'function') {
expect(environment.parsers).toEqual(
expect.objectContaining({ [name]: parser }),
);
}
});
});
});
16 changes: 9 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
array,
boolean,
email,
float,
Expand All @@ -17,20 +18,21 @@ import {
} from './parsers';

const parsers = {
string,
array,
boolean,
integer,
float,
email,
float,
integer,
url,
ipAddress,
port,
whitelist,
positiveInteger,
nonPositiveInteger,
negativeInteger,
nonNegativeInteger,
nonPositiveInteger,
port,
positiveInteger,
regex,
string,
whitelist,
};

export { Parser, parsers };
Expand Down

0 comments on commit 998dbfc

Please sign in to comment.