mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
change: Drop Node 10 support.
This commit is contained in:
parent
16d447f221
commit
03ffaaed43
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -14,7 +14,6 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version:
|
node-version:
|
||||||
- 10.x
|
|
||||||
- 12.x
|
- 12.x
|
||||||
- 14.x
|
- 14.x
|
||||||
env:
|
env:
|
||||||
|
@ -26,8 +26,6 @@ export class SparqlUpdateBodyParser extends BodyParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async handle({ request, metadata }: BodyParserArgs): Promise<SparqlUpdatePatch> {
|
public async handle({ request, metadata }: BodyParserArgs): Promise<SparqlUpdatePatch> {
|
||||||
// Note that readableObjectMode is only defined starting from Node 12
|
|
||||||
// It is impossible to check if object mode is enabled in Node 10 (without accessing private variables)
|
|
||||||
const options = { objectMode: request.readableObjectMode };
|
const options = { objectMode: request.readableObjectMode };
|
||||||
const toAlgebraStream = pipeSafely(request, new PassThrough(options));
|
const toAlgebraStream = pipeSafely(request, new PassThrough(options));
|
||||||
const dataCopy = pipeSafely(request, new PassThrough(options));
|
const dataCopy = pipeSafely(request, new PassThrough(options));
|
||||||
|
@ -37,9 +37,7 @@ export class RdfToQuadConverter extends TypedRepresentationConverter {
|
|||||||
baseIRI,
|
baseIRI,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Wrap the stream such that errors are transformed
|
const pass = new PassThrough({ objectMode: true });
|
||||||
// (Node 10 requires both writableObjectMode and readableObjectMode)
|
|
||||||
const pass = new PassThrough({ writableObjectMode: true, readableObjectMode: true });
|
|
||||||
const data = pipeSafely(rawQuads, pass, (error): Error => new UnsupportedHttpError(error.message));
|
const data = pipeSafely(rawQuads, pass, (error): Error => new UnsupportedHttpError(error.message));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { namedNode, quad } from '@rdfjs/data-model';
|
import { namedNode, quad } from '@rdfjs/data-model';
|
||||||
|
import arrayifyStream from 'arrayify-stream';
|
||||||
import { Algebra } from 'sparqlalgebrajs';
|
import { Algebra } from 'sparqlalgebrajs';
|
||||||
import * as algebra from 'sparqlalgebrajs';
|
import * as algebra from 'sparqlalgebrajs';
|
||||||
import streamifyArray from 'streamify-array';
|
import streamifyArray from 'streamify-array';
|
||||||
@ -8,7 +9,6 @@ import { RepresentationMetadata } from '../../../../src/ldp/representation/Repre
|
|||||||
import type { HttpRequest } from '../../../../src/server/HttpRequest';
|
import type { HttpRequest } from '../../../../src/server/HttpRequest';
|
||||||
import { UnsupportedHttpError } from '../../../../src/util/errors/UnsupportedHttpError';
|
import { UnsupportedHttpError } from '../../../../src/util/errors/UnsupportedHttpError';
|
||||||
import { UnsupportedMediaTypeHttpError } from '../../../../src/util/errors/UnsupportedMediaTypeHttpError';
|
import { UnsupportedMediaTypeHttpError } from '../../../../src/util/errors/UnsupportedMediaTypeHttpError';
|
||||||
import { readableToString } from '../../../../src/util/StreamUtil';
|
|
||||||
|
|
||||||
describe('A SparqlUpdateBodyParser', (): void => {
|
describe('A SparqlUpdateBodyParser', (): void => {
|
||||||
const bodyParser = new SparqlUpdateBodyParser();
|
const bodyParser = new SparqlUpdateBodyParser();
|
||||||
@ -56,9 +56,8 @@ describe('A SparqlUpdateBodyParser', (): void => {
|
|||||||
expect(result.binary).toBe(true);
|
expect(result.binary).toBe(true);
|
||||||
expect(result.metadata).toBe(input.metadata);
|
expect(result.metadata).toBe(input.metadata);
|
||||||
|
|
||||||
// Workaround for Node 10 not exposing objectMode
|
expect(await arrayifyStream(result.data)).toEqual(
|
||||||
expect(await readableToString(result.data)).toEqual(
|
[ 'DELETE DATA { <http://test.com/s> <http://test.com/p> <http://test.com/o> }' ],
|
||||||
'DELETE DATA { <http://test.com/s> <http://test.com/p> <http://test.com/o> }',
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user