refactor: Remove streamify array dependency

This commit is contained in:
Joachim Van Herwegen
2021-08-02 13:29:52 +02:00
parent 63e88578c3
commit 2ae95bd167
12 changed files with 70 additions and 106 deletions

View File

@@ -3,12 +3,11 @@ import arrayifyStream from 'arrayify-stream';
import type { ParserOptions } from 'n3';
import { StreamParser, StreamWriter } from 'n3';
import type { Quad } from 'rdf-js';
import streamifyArray from 'streamify-array';
import type { Guarded } from './GuardedStream';
import { pipeSafely } from './StreamUtil';
import { guardedStreamFrom, pipeSafely } from './StreamUtil';
export function serializeQuads(quads: Quad[], contentType?: string): Guarded<Readable> {
return pipeSafely(streamifyArray(quads), new StreamWriter({ format: contentType }));
return pipeSafely(guardedStreamFrom(quads), new StreamWriter({ format: contentType }));
}
/**