-
Notifications
You must be signed in to change notification settings - Fork 0
/
oblak.js
54 lines (44 loc) · 1.14 KB
/
oblak.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
'use strict';
// debug heper for MaxEventLiteners
const { EventEmitter } = require('events');
const originalAddListener = EventEmitter.prototype.addListener;
const addListener = function addListener(...params) {
originalAddListener.apply(this, params);
const [type] = params;
const numListeners = this.listeners(type).length;
const max = typeof this._maxListeners === 'number' ? this._maxListeners : 10;
/*
if (max !== 0 && numListeners > max)
throw new Error(
`Too many listeners of type "${
type
}" added to EventEmitter. Max is ${
max
} and we've added ${
numListeners
}.`,
);
*/
return this;
};
EventEmitter.prototype.addListener = addListener;
EventEmitter.prototype.on = addListener;
// debug heper for MaxEventLiteners
/**
* Generated by Oblak CLI
*/
const Oblak = require('oblak');
const oblakData = require('./plugins/oblak-data');
process.on('uncaughtException', (e) => {
throw e;
});
process.on('unhandledRejection', (e) => {
throw e;
});
// oblak boot strap
const oblak = Oblak.debug();
oblakData(oblak);
module.exports = oblak;
// not needed with new oblak.
// oblak.init();
// Oblak.debug().clear();