Skip to content

Commit

Permalink
Fix incompatibility with WhatWG streams
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jun 3, 2020
1 parent 43e156b commit f731841
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/JsonLdParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class JsonLdParser extends Transform implements RDF.Sink<EventEmitter, RD
private lastOnValueJob: Promise<void>;

constructor(options?: IJsonLdParserOptions) {
super({ objectMode: true });
super({ readableObjectMode: true });
options = options || {};
this.options = options;
this.parsingContext = new ParsingContext({ parser: this, ...options });
Expand Down Expand Up @@ -151,7 +151,7 @@ export class JsonLdParser extends Transform implements RDF.Sink<EventEmitter, RD
* @return {RDF.Stream} A quad stream.
*/
public import(stream: EventEmitter): RDF.Stream {
const output = new PassThrough({ objectMode: true });
const output = new PassThrough({ readableObjectMode: true });
stream.on('error', (error) => parsed.emit('error', error));
stream.on('data', (data) => output.write(data));
stream.on('end', () => output.emit('end'));
Expand Down

0 comments on commit f731841

Please sign in to comment.