Skip to content

Commit

Permalink
node 11 + cleanup. Closes #37
Browse files Browse the repository at this point in the history
  • Loading branch information
hueniverse committed Oct 31, 2018
1 parent 093d7eb commit 712a548
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 31 deletions.
23 changes: 7 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
.idea
*.iml
npm-debug.log
dump.rdb
node_modules
results.tap
results.xml
config.json
.DS_Store
*/.DS_Store
*/*/.DS_Store
._*
*/._*
*/*/._*
**/node_modules
**/package-lock.json

coverage.*
.settings
package-lock.json

**/.DS_Store
**/._*

**/*.pem
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ language: node_js

node_js:
- "8"
- "9"
- "10"
- "11"
- "node"

sudo: false

6 changes: 1 addition & 5 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016-2017, Project contributors
Copyright (c) 2016-2018, Project contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand All @@ -22,7 +22,3 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

* * *

The complete list of contributors can be found at: https://github.com/hapijs/podium/graphs/contributors
9 changes: 8 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,14 @@ internals.Podium.prototype.emit = async function (criteria, data, _generated) {
if (criteria.tags &&
Array.isArray(criteria.tags)) {

criteria.tags = Hoek.mapToObject(criteria.tags);
// Map array to object

const tags = {};
for (const tag of criteria.tags) {
tags[tag] = true;
}

criteria.tags = tags;
}

if (event.handlers) {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"event"
],
"engines": {
"node": ">=8.9.0"
"node": ">=8.12.0"
},
"dependencies": {
"hoek": "5.x.x",
"joi": "13.x.x"
"joi": "14.x.x"
},
"devDependencies": {
"code": "5.x.x",
"lab": "15.x.x",
"lab": "17.x.x",
"teamwork": "3.x.x"
},
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ describe('Podium', () => {
it('reuses podium events to decorate a new one', async () => {

const source = new Podium(['a', 'b']);
const Emitter = function () { };
Hoek.inherits(Emitter, Podium);
const Emitter = class extends Podium { };

const emitter = new Emitter();
Podium.decorate(emitter, source);
Expand Down Expand Up @@ -597,8 +596,8 @@ describe('Podium', () => {
const emitter = new Podium('test');
let counter = 0;
emitter.once({ name: 'test', channels: 'x' }, () => ++counter);
emitter.emit({ name: 'test', channel: 'y' } );
emitter.emit({ name: 'test', channel: 'x' } );
emitter.emit({ name: 'test', channel: 'y' });
emitter.emit({ name: 'test', channel: 'x' });
await emitter.emit('test', null);
expect(counter).to.equal(1);
});
Expand All @@ -622,6 +621,7 @@ describe('Podium', () => {

handled++;
};

emitter.addListener('test', handler);

await emitter.emit('test', null);
Expand Down

0 comments on commit 712a548

Please sign in to comment.