mqtt 2.18.9 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CONTRIBUTING.md +27 -27
  2. package/LICENSE.md +15 -15
  3. package/README.md +689 -612
  4. package/bin/pub.js +146 -146
  5. package/bin/sub.js +123 -123
  6. package/dist/mqtt.js +11916 -14116
  7. package/dist/mqtt.min.js +1 -1
  8. package/doc/help.txt +8 -8
  9. package/doc/publish.txt +26 -26
  10. package/doc/subscribe.txt +26 -26
  11. package/examples/client/secure-client.js +24 -24
  12. package/examples/client/simple-both.js +13 -13
  13. package/examples/client/simple-publish.js +7 -7
  14. package/examples/client/simple-subscribe.js +9 -9
  15. package/examples/tls client/crt.ca.cg.pem +34 -34
  16. package/examples/tls client/mqttclient.js +48 -48
  17. package/examples/tls client/tls-cert.pem +13 -13
  18. package/examples/tls client/tls-key.pem +15 -15
  19. package/examples/wss/client.js +49 -49
  20. package/examples/wss/client_with_proxy.js +58 -58
  21. package/lib/client.js +1460 -1129
  22. package/lib/connect/ali.js +130 -0
  23. package/lib/connect/index.js +157 -149
  24. package/lib/connect/tcp.js +19 -19
  25. package/lib/connect/tls.js +41 -41
  26. package/lib/connect/ws.js +92 -92
  27. package/lib/connect/wx.js +134 -110
  28. package/lib/store.js +140 -140
  29. package/lib/validations.js +52 -52
  30. package/mqtt.js +41 -41
  31. package/package.json +112 -107
  32. package/test/abstract_client.js +3084 -2667
  33. package/test/abstract_store.js +135 -135
  34. package/test/browser/server.js +132 -132
  35. package/test/browser/test.js +92 -92
  36. package/test/client.js +1129 -544
  37. package/test/helpers/private-csr.pem +16 -16
  38. package/test/helpers/private-key.pem +27 -27
  39. package/test/helpers/public-cert.pem +19 -19
  40. package/test/helpers/public-key.pem +9 -9
  41. package/test/helpers/server.js +52 -52
  42. package/test/helpers/server_process.js +9 -9
  43. package/test/helpers/tls-cert.pem +14 -14
  44. package/test/helpers/tls-csr.pem +11 -11
  45. package/test/helpers/tls-key.pem +15 -15
  46. package/test/helpers/wrong-cert.pem +13 -13
  47. package/test/helpers/wrong-csr.pem +11 -11
  48. package/test/helpers/wrong-key.pem +15 -15
  49. package/test/mocha.opts +4 -4
  50. package/test/mqtt.js +230 -230
  51. package/test/mqtt_store.js +9 -9
  52. package/test/secure_client.js +157 -157
  53. package/test/server.js +93 -65
  54. package/test/store.js +10 -10
  55. package/test/typescript/broker-connect-subscribe-and-publish.js +24 -0
  56. package/test/typescript/broker-connect-subscribe-and-publish.js.map +1 -0
  57. package/test/typescript/broker-connect-subscribe-and-publish.ts +22 -22
  58. package/test/typescript/tsconfig.json +14 -14
  59. package/test/util.js +13 -13
  60. package/test/websocket_client.js +144 -144
  61. package/types/index.d.ts +27 -27
  62. package/types/lib/client-options.d.ts +178 -137
  63. package/types/lib/client.d.ts +231 -196
  64. package/types/lib/connect/index.d.ts +10 -10
  65. package/types/lib/store-options.d.ts +6 -6
  66. package/types/lib/store.d.ts +46 -46
  67. package/test/browser/wx.js +0 -93
@@ -1,157 +1,157 @@
1
- 'use strict'
2
-
3
- var mqtt = require('..')
4
- var path = require('path')
5
- var abstractClientTests = require('./abstract_client')
6
- var fs = require('fs')
7
- var port = 9899
8
- var KEY = path.join(__dirname, 'helpers', 'tls-key.pem')
9
- var CERT = path.join(__dirname, 'helpers', 'tls-cert.pem')
10
- var WRONG_CERT = path.join(__dirname, 'helpers', 'wrong-cert.pem')
11
- var Server = require('./server')
12
-
13
- var server = new Server.SecureServer({
14
- key: fs.readFileSync(KEY),
15
- cert: fs.readFileSync(CERT)
16
- }, function (client) {
17
- client.on('connect', function (packet) {
18
- if (packet.clientId === 'invalid') {
19
- client.connack({returnCode: 2})
20
- } else {
21
- server.emit('connect', client)
22
- client.connack({returnCode: 0})
23
- }
24
- })
25
-
26
- client.on('publish', function (packet) {
27
- setImmediate(function () {
28
- /* jshint -W027 */
29
- /* eslint default-case:0 */
30
- switch (packet.qos) {
31
- case 0:
32
- break
33
- case 1:
34
- client.puback(packet)
35
- break
36
- case 2:
37
- client.pubrec(packet)
38
- break
39
- }
40
- /* jshint +W027 */
41
- })
42
- })
43
-
44
- client.on('pubrel', function (packet) {
45
- client.pubcomp(packet)
46
- })
47
-
48
- client.on('pubrec', function (packet) {
49
- client.pubrel(packet)
50
- })
51
-
52
- client.on('pubcomp', function () {
53
- // Nothing to be done
54
- })
55
-
56
- client.on('subscribe', function (packet) {
57
- client.suback({
58
- messageId: packet.messageId,
59
- granted: packet.subscriptions.map(function (e) {
60
- return e.qos
61
- })
62
- })
63
- })
64
-
65
- client.on('unsubscribe', function (packet) {
66
- client.unsuback(packet)
67
- })
68
-
69
- client.on('pingreq', function () {
70
- client.pingresp()
71
- })
72
- }).listen(port)
73
-
74
- describe('MqttSecureClient', function () {
75
- var config = { protocol: 'mqtts', port: port, rejectUnauthorized: false }
76
- abstractClientTests(server, config)
77
-
78
- describe('with secure parameters', function () {
79
- it('should validate successfully the CA', function (done) {
80
- var client = mqtt.connect({
81
- protocol: 'mqtts',
82
- port: port,
83
- ca: [fs.readFileSync(CERT)],
84
- rejectUnauthorized: true
85
- })
86
-
87
- client.on('error', function (err) {
88
- done(err)
89
- })
90
-
91
- server.once('connect', function () {
92
- done()
93
- })
94
- })
95
-
96
- it('should validate successfully the CA using URI', function (done) {
97
- var client = mqtt.connect('mqtts://localhost:' + port, {
98
- ca: [fs.readFileSync(CERT)],
99
- rejectUnauthorized: true
100
- })
101
-
102
- client.on('error', function (err) {
103
- done(err)
104
- })
105
-
106
- server.once('connect', function () {
107
- done()
108
- })
109
- })
110
-
111
- it('should validate successfully the CA using URI with path', function (done) {
112
- var client = mqtt.connect('mqtts://localhost:' + port + '/', {
113
- ca: [fs.readFileSync(CERT)],
114
- rejectUnauthorized: true
115
- })
116
-
117
- client.on('error', function (err) {
118
- done(err)
119
- })
120
-
121
- server.once('connect', function () {
122
- done()
123
- })
124
- })
125
-
126
- it('should validate unsuccessfully the CA', function (done) {
127
- var client = mqtt.connect({
128
- protocol: 'mqtts',
129
- port: port,
130
- ca: [fs.readFileSync(WRONG_CERT)],
131
- rejectUnauthorized: true
132
- })
133
-
134
- client.once('error', function () {
135
- done()
136
- client.end()
137
- client.on('error', function () {})
138
- })
139
- })
140
-
141
- it('should emit close on TLS error', function (done) {
142
- var client = mqtt.connect({
143
- protocol: 'mqtts',
144
- port: port,
145
- ca: [fs.readFileSync(WRONG_CERT)],
146
- rejectUnauthorized: true
147
- })
148
-
149
- client.on('error', function () {})
150
-
151
- // TODO node v0.8.x emits multiple close events
152
- client.once('close', function () {
153
- done()
154
- })
155
- })
156
- })
157
- })
1
+ 'use strict'
2
+
3
+ var mqtt = require('..')
4
+ var path = require('path')
5
+ var abstractClientTests = require('./abstract_client')
6
+ var fs = require('fs')
7
+ var port = 9899
8
+ var KEY = path.join(__dirname, 'helpers', 'tls-key.pem')
9
+ var CERT = path.join(__dirname, 'helpers', 'tls-cert.pem')
10
+ var WRONG_CERT = path.join(__dirname, 'helpers', 'wrong-cert.pem')
11
+ var Server = require('./server')
12
+
13
+ var server = new Server.SecureServer({
14
+ key: fs.readFileSync(KEY),
15
+ cert: fs.readFileSync(CERT)
16
+ }, function (client) {
17
+ client.on('connect', function (packet) {
18
+ if (packet.clientId === 'invalid') {
19
+ client.connack({returnCode: 2})
20
+ } else {
21
+ server.emit('connect', client)
22
+ client.connack({returnCode: 0})
23
+ }
24
+ })
25
+
26
+ client.on('publish', function (packet) {
27
+ setImmediate(function () {
28
+ /* jshint -W027 */
29
+ /* eslint default-case:0 */
30
+ switch (packet.qos) {
31
+ case 0:
32
+ break
33
+ case 1:
34
+ client.puback(packet)
35
+ break
36
+ case 2:
37
+ client.pubrec(packet)
38
+ break
39
+ }
40
+ /* jshint +W027 */
41
+ })
42
+ })
43
+
44
+ client.on('pubrel', function (packet) {
45
+ client.pubcomp(packet)
46
+ })
47
+
48
+ client.on('pubrec', function (packet) {
49
+ client.pubrel(packet)
50
+ })
51
+
52
+ client.on('pubcomp', function () {
53
+ // Nothing to be done
54
+ })
55
+
56
+ client.on('subscribe', function (packet) {
57
+ client.suback({
58
+ messageId: packet.messageId,
59
+ granted: packet.subscriptions.map(function (e) {
60
+ return e.qos
61
+ })
62
+ })
63
+ })
64
+
65
+ client.on('unsubscribe', function (packet) {
66
+ client.unsuback(packet)
67
+ })
68
+
69
+ client.on('pingreq', function () {
70
+ client.pingresp()
71
+ })
72
+ }).listen(port)
73
+
74
+ describe('MqttSecureClient', function () {
75
+ var config = { protocol: 'mqtts', port: port, rejectUnauthorized: false }
76
+ abstractClientTests(server, config)
77
+
78
+ describe('with secure parameters', function () {
79
+ it('should validate successfully the CA', function (done) {
80
+ var client = mqtt.connect({
81
+ protocol: 'mqtts',
82
+ port: port,
83
+ ca: [fs.readFileSync(CERT)],
84
+ rejectUnauthorized: true
85
+ })
86
+
87
+ client.on('error', function (err) {
88
+ done(err)
89
+ })
90
+
91
+ server.once('connect', function () {
92
+ done()
93
+ })
94
+ })
95
+
96
+ it('should validate successfully the CA using URI', function (done) {
97
+ var client = mqtt.connect('mqtts://localhost:' + port, {
98
+ ca: [fs.readFileSync(CERT)],
99
+ rejectUnauthorized: true
100
+ })
101
+
102
+ client.on('error', function (err) {
103
+ done(err)
104
+ })
105
+
106
+ server.once('connect', function () {
107
+ done()
108
+ })
109
+ })
110
+
111
+ it('should validate successfully the CA using URI with path', function (done) {
112
+ var client = mqtt.connect('mqtts://localhost:' + port + '/', {
113
+ ca: [fs.readFileSync(CERT)],
114
+ rejectUnauthorized: true
115
+ })
116
+
117
+ client.on('error', function (err) {
118
+ done(err)
119
+ })
120
+
121
+ server.once('connect', function () {
122
+ done()
123
+ })
124
+ })
125
+
126
+ it('should validate unsuccessfully the CA', function (done) {
127
+ var client = mqtt.connect({
128
+ protocol: 'mqtts',
129
+ port: port,
130
+ ca: [fs.readFileSync(WRONG_CERT)],
131
+ rejectUnauthorized: true
132
+ })
133
+
134
+ client.once('error', function () {
135
+ done()
136
+ client.end()
137
+ client.on('error', function () {})
138
+ })
139
+ })
140
+
141
+ it('should emit close on TLS error', function (done) {
142
+ var client = mqtt.connect({
143
+ protocol: 'mqtts',
144
+ port: port,
145
+ ca: [fs.readFileSync(WRONG_CERT)],
146
+ rejectUnauthorized: true
147
+ })
148
+
149
+ client.on('error', function () {})
150
+
151
+ // TODO node v0.8.x emits multiple close events
152
+ client.once('close', function () {
153
+ done()
154
+ })
155
+ })
156
+ })
157
+ })
package/test/server.js CHANGED
@@ -1,65 +1,93 @@
1
- 'use strict'
2
-
3
- var net = require('net')
4
- var tls = require('tls')
5
- var inherits = require('inherits')
6
- var Connection = require('mqtt-connection')
7
- var MqttServer
8
- var MqttSecureServer
9
-
10
- function setupConnection (duplex) {
11
- var connection = new Connection(duplex)
12
- this.emit('client', connection)
13
- }
14
-
15
- /*
16
- * MqttServer
17
- *
18
- * @param {Function} listener - fired on client connection
19
- */
20
- MqttServer = module.exports = function Server (listener) {
21
- if (!(this instanceof Server)) {
22
- return new Server(listener)
23
- }
24
-
25
- net.Server.call(this)
26
-
27
- this.on('connection', setupConnection)
28
-
29
- if (listener) {
30
- this.on('client', listener)
31
- }
32
-
33
- return this
34
- }
35
- inherits(MqttServer, net.Server)
36
-
37
- /**
38
- * MqttSecureServer
39
- *
40
- * @param {Object} opts - server options
41
- * @param {Function} listener
42
- */
43
- MqttSecureServer = module.exports.SecureServer =
44
- function SecureServer (opts, listener) {
45
- if (!(this instanceof SecureServer)) {
46
- return new SecureServer(opts, listener)
47
- }
48
-
49
- // new MqttSecureServer(function(){})
50
- if (typeof opts === 'function') {
51
- listener = opts
52
- opts = {}
53
- }
54
-
55
- tls.Server.call(this, opts)
56
-
57
- if (listener) {
58
- this.on('client', listener)
59
- }
60
-
61
- this.on('secureConnection', setupConnection)
62
-
63
- return this
64
- }
65
- inherits(MqttSecureServer, tls.Server)
1
+ 'use strict'
2
+
3
+ var net = require('net')
4
+ var tls = require('tls')
5
+ var inherits = require('inherits')
6
+ var Connection = require('mqtt-connection')
7
+ var MqttServer
8
+ var FastMqttServer
9
+ var MqttSecureServer
10
+
11
+ function setupConnection (duplex) {
12
+ var that = this
13
+ var connection = new Connection(duplex, function () {
14
+ that.emit('client', connection)
15
+ })
16
+ }
17
+
18
+ /*
19
+ * MqttServer
20
+ *
21
+ * @param {Function} listener - fired on client connection
22
+ */
23
+ MqttServer = module.exports = function Server (listener) {
24
+ if (!(this instanceof Server)) {
25
+ return new Server(listener)
26
+ }
27
+
28
+ net.Server.call(this)
29
+
30
+ this.on('connection', setupConnection)
31
+
32
+ if (listener) {
33
+ this.on('client', listener)
34
+ }
35
+
36
+ return this
37
+ }
38
+ inherits(MqttServer, net.Server)
39
+
40
+ /*
41
+ * FastMqttServer(w/o waiting for initialization)
42
+ *
43
+ * @param {Function} listener - fired on client connection
44
+ */
45
+ FastMqttServer = module.exports.FastMqttServer = function Server (listener) {
46
+ if (!(this instanceof Server)) {
47
+ return new Server(listener)
48
+ }
49
+
50
+ net.Server.call(this)
51
+
52
+ this.on('connection', function (duplex) {
53
+ var connection = new Connection(duplex)
54
+ this.emit('client', connection)
55
+ })
56
+
57
+ if (listener) {
58
+ this.on('client', listener)
59
+ }
60
+
61
+ return this
62
+ }
63
+ inherits(FastMqttServer, net.Server)
64
+
65
+ /**
66
+ * MqttSecureServer
67
+ *
68
+ * @param {Object} opts - server options
69
+ * @param {Function} listener
70
+ */
71
+ MqttSecureServer = module.exports.SecureServer =
72
+ function SecureServer (opts, listener) {
73
+ if (!(this instanceof SecureServer)) {
74
+ return new SecureServer(opts, listener)
75
+ }
76
+
77
+ // new MqttSecureServer(function(){})
78
+ if (typeof opts === 'function') {
79
+ listener = opts
80
+ opts = {}
81
+ }
82
+
83
+ tls.Server.call(this, opts)
84
+
85
+ if (listener) {
86
+ this.on('client', listener)
87
+ }
88
+
89
+ this.on('secureConnection', setupConnection)
90
+
91
+ return this
92
+ }
93
+ inherits(MqttSecureServer, tls.Server)
package/test/store.js CHANGED
@@ -1,10 +1,10 @@
1
- 'use strict'
2
-
3
- var Store = require('../lib/store')
4
- var abstractTest = require('../test/abstract_store')
5
-
6
- describe('in-memory store', function () {
7
- abstractTest(function (done) {
8
- done(null, new Store())
9
- })
10
- })
1
+ 'use strict'
2
+
3
+ var Store = require('../lib/store')
4
+ var abstractTest = require('../test/abstract_store')
5
+
6
+ describe('in-memory store', function () {
7
+ abstractTest(function (done) {
8
+ done(null, new Store())
9
+ })
10
+ })
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // relative path uses package.json {"types":"types/index.d.ts", ...}
4
+ var __1 = require("../..");
5
+ var BROKER = 'test.mosquitto.org';
6
+ var PAYLOAD = 'hello from TS';
7
+ var TOPIC = 'typescript-test-' + Math.random().toString(16).substr(2);
8
+ var opts = {};
9
+ console.log("connect(" + JSON.stringify(BROKER) + ")");
10
+ var client = __1.connect("mqtt://" + BROKER, opts);
11
+ client.subscribe((_a = {}, _a[TOPIC] = 2, _a), function (err, granted) {
12
+ granted.forEach(function (_a) {
13
+ var topic = _a.topic, qos = _a.qos;
14
+ console.log("subscribed to " + topic + " with qos=" + qos);
15
+ });
16
+ client.publish(TOPIC, PAYLOAD, { qos: 2 });
17
+ }).on('message', function (topic, payload) {
18
+ console.log("message from " + topic + ": " + payload);
19
+ client.end();
20
+ }).on('connect', function (packet) {
21
+ console.log('connected!', JSON.stringify(packet));
22
+ });
23
+ var _a;
24
+ //# sourceMappingURL=broker-connect-subscribe-and-publish.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"broker-connect-subscribe-and-publish.js","sourceRoot":"","sources":["broker-connect-subscribe-and-publish.ts"],"names":[],"mappings":";;AAAA,oEAAoE;AACpE,2BAAqE;AACrE,IAAM,MAAM,GAAG,oBAAoB,CAAA;AAEnC,IAAM,OAAO,GAAG,eAAe,CAAA;AAC/B,IAAM,KAAK,GAAG,kBAAkB,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AACvE,IAAM,IAAI,GAAmB,EAAE,CAAA;AAE/B,OAAO,CAAC,GAAG,CAAC,aAAW,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAG,CAAC,CAAA;AACjD,IAAM,MAAM,GAAU,WAAO,CAAC,YAAU,MAAQ,EAAE,IAAI,CAAC,CAAA;AAEvD,MAAM,CAAC,SAAS,WAAE,GAAC,KAAK,IAAG,CAAC,OAAG,UAAC,GAAG,EAAE,OAAO;IACxC,OAAO,CAAC,OAAO,CAAC,UAAC,EAAY;YAAX,gBAAK,EAAE,YAAG;QACxB,OAAO,CAAC,GAAG,CAAC,mBAAiB,KAAK,kBAAa,GAAK,CAAC,CAAA;IACzD,CAAC,CAAC,CAAA;IACF,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAC,GAAG,EAAE,CAAC,EAAC,CAAC,CAAA;AAC5C,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,UAAC,KAAa,EAAE,OAAe;IAC5C,OAAO,CAAC,GAAG,CAAC,kBAAgB,KAAK,UAAK,OAAS,CAAC,CAAA;IAChD,MAAM,CAAC,GAAG,EAAE,CAAA;AAChB,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,UAAC,MAAsB;IACpC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;AACrD,CAAC,CAAC,CAAA"}
@@ -1,22 +1,22 @@
1
- // relative path uses package.json {"types":"types/index.d.ts", ...}
2
- import {IClientOptions, Client, connect, IConnackPacket} from '../..'
3
- const BROKER = 'test.mosquitto.org'
4
-
5
- const PAYLOAD = 'hello from TS'
6
- const TOPIC = 'typescript-test-' + Math.random().toString(16).substr(2)
7
- const opts: IClientOptions = {}
8
-
9
- console.log(`connect(${JSON.stringify(BROKER)})`)
10
- const client:Client = connect(`mqtt://${BROKER}`, opts)
11
-
12
- client.subscribe({[TOPIC]: 2}, (err, granted) => {
13
- granted.forEach(({topic, qos}) => {
14
- console.log(`subscribed to ${topic} with qos=${qos}`)
15
- })
16
- client.publish(TOPIC, PAYLOAD, {qos: 2})
17
- }).on('message', (topic: string, payload: Buffer) => {
18
- console.log(`message from ${topic}: ${payload}`)
19
- client.end()
20
- }).on('connect', (packet: IConnackPacket) => {
21
- console.log('connected!', JSON.stringify(packet))
22
- })
1
+ // relative path uses package.json {"types":"types/index.d.ts", ...}
2
+ import {IClientOptions, Client, connect, IConnackPacket} from '../..'
3
+ const BROKER = 'test.mosquitto.org'
4
+
5
+ const PAYLOAD = 'hello from TS'
6
+ const TOPIC = 'typescript-test-' + Math.random().toString(16).substr(2)
7
+ const opts: IClientOptions = {}
8
+
9
+ console.log(`connect(${JSON.stringify(BROKER)})`)
10
+ const client:Client = connect(`mqtt://${BROKER}`, opts)
11
+
12
+ client.subscribe({[TOPIC]: {qos: 2}}, (err, granted) => {
13
+ granted.forEach(({topic, qos}) => {
14
+ console.log(`subscribed to ${topic} with qos=${qos}`)
15
+ })
16
+ client.publish(TOPIC, PAYLOAD, {qos: 2})
17
+ }).on('message', (topic: string, payload: Buffer) => {
18
+ console.log(`message from ${topic}: ${payload}`)
19
+ client.end()
20
+ }).on('connect', (packet: IConnackPacket) => {
21
+ console.log('connected!', JSON.stringify(packet))
22
+ })
@@ -1,14 +1,14 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "target": "es5",
5
- "moduleResolution": "node",
6
- "noEmitOnError": true,
7
- "noImplicitAny": true,
8
- "alwaysStrict": true,
9
- "strictNullChecks": true,
10
- "noImplicitReturns": true,
11
- "noImplicitThis": true,
12
- "sourceMap": true
13
- }
14
- }
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "target": "es5",
5
+ "moduleResolution": "node",
6
+ "noEmitOnError": true,
7
+ "noImplicitAny": true,
8
+ "alwaysStrict": true,
9
+ "strictNullChecks": true,
10
+ "noImplicitReturns": true,
11
+ "noImplicitThis": true,
12
+ "sourceMap": true
13
+ }
14
+ }
package/test/util.js CHANGED
@@ -1,13 +1,13 @@
1
- 'use strict'
2
-
3
- var through = require('through2')
4
-
5
- module.exports.testStream = function () {
6
- return through(function (buf, enc, cb) {
7
- var that = this
8
- setImmediate(function () {
9
- that.push(buf)
10
- cb()
11
- })
12
- })
13
- }
1
+ 'use strict'
2
+
3
+ var through = require('through2')
4
+
5
+ module.exports.testStream = function () {
6
+ return through(function (buf, enc, cb) {
7
+ var that = this
8
+ setImmediate(function () {
9
+ that.push(buf)
10
+ cb()
11
+ })
12
+ })
13
+ }