Skip to content

Commit 4bc2bd5

Browse files
committed
Prepare stream as extension
1 parent a9cc363 commit 4bc2bd5

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

lib/stream.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
'use strict';
22

3-
const extend = parser => {
3+
const mixinMethods = parser => {};
44

5+
function stream() {
6+
mixinMethods(this);
7+
this.stream = true;
8+
return this
59
};
610

7-
module.exports = extend;
11+
module.exports = stream;

schemaparser.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ const extensions = {
77
stream: require('./lib/stream.js')
88
};
99

10-
Parser.prototype.extend = function(
11-
extensionName
12-
) {
13-
const extension = extensions[extensionName];
14-
extension(this);
15-
return this;
16-
};
10+
Object.assign(Parser.prototype, extensions);
1711

1812
module.exports = Parser;

0 commit comments

Comments
 (0)