Skip to content

Commit

Permalink
Add default ES module default exports to make TypeScript integration …
Browse files Browse the repository at this point in the history
…easier (#37)
  • Loading branch information
daffl committed Aug 28, 2018
1 parent 91148c3 commit 68efbb8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/authentication-oauth1/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const INCLUDE_KEYS = [

const EXCLUDE_KEYS = ['Verifier', 'Strategy', 'formatter'];

module.exports = function init (options = {}) {
function init (options = {}) {
return function oauth1Auth () {
const app = this;
const _super = app.setup;
Expand Down Expand Up @@ -102,9 +102,12 @@ module.exports = function init (options = {}) {
return result;
};
};
};
}

module.exports = init;

// Exposed Modules
Object.assign(module.exports, {
default: init,
Verifier: DefaultVerifier
});
4 changes: 4 additions & 0 deletions packages/authentication-oauth1/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ describe('@feathersjs/authentication-oauth1', () => {
expect(typeof oauth1).to.equal('function');
});

it('exports default', () => {
expect(oauth1.default).to.equal(oauth1);
});

it('exposes the Verifier class', () => {
expect(typeof Verifier).to.equal('function');
expect(typeof oauth1.Verifier).to.equal('function');
Expand Down

0 comments on commit 68efbb8

Please sign in to comment.