Skip to content

Commit

Permalink
Merge pull request #17 from fox1t/master
Browse files Browse the repository at this point in the history
Adds missing exports (infamous triplet)
  • Loading branch information
fox1t authored Oct 19, 2020
2 parents 0165755 + 187049c commit 75e4303
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ declare function loadAndValidateEnvironment(
): EnvSchemaData;

export default loadAndValidateEnvironment;
export { loadAndValidateEnvironment as envSchema };
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ function loadAndValidateEnvironment (_opts) {
}

module.exports = loadAndValidateEnvironment
module.exports.default = loadAndValidateEnvironment
module.exports.envSchema = loadAndValidateEnvironment
4 changes: 3 additions & 1 deletion test/types/types.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expectError, expectType } from "tsd";
import envSchema, { EnvSchemaData, EnvSchemaOpt } from "../..";
import envSchema, { EnvSchemaData, EnvSchemaOpt, envSchema as envSchemaNamed, default as envSchemaDefault } from "../..";

const schema = {
type: "object",
Expand All @@ -16,6 +16,8 @@ const data = {
};

expectType<EnvSchemaData>(envSchema());
expectType<EnvSchemaData>(envSchemaNamed());
expectType<EnvSchemaData>(envSchemaDefault());

const emptyOpt: EnvSchemaOpt = {};
expectType<EnvSchemaOpt>(emptyOpt);
Expand Down

0 comments on commit 75e4303

Please sign in to comment.