Skip to content

Commit 1a3d55f

Browse files
Merge pull request #59 from linkedconnections/development
v1.4.6
2 parents 0430efa + 323f4d1 commit 1a3d55f

File tree

8 files changed

+178
-181
lines changed

8 files changed

+178
-181
lines changed

.github/workflows/build-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: Node.js CI
55

66
on:
77
push:
8-
branches: [ master, development ]
8+
branches: [ master ]
99
pull_request:
10-
branches: [ master, development ]
10+
branches: [ master ]
1111

1212
jobs:
1313
test:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# gtfsrt2lc
22

3-
[![Build Status](https://travis-ci.org/linkedconnections/gtfsrt2lc.svg?branch=master)](https://travis-ci.org/linkedconnections/gtfsrt2lc) [![npm](https://img.shields.io/npm/v/gtfsrt2lc.svg?style=popout)](https://npmjs.com/package/gtfsrt2lc) [![Greenkeeper badge](https://badges.greenkeeper.io/linkedconnections/gtfsrt2lc.svg)](https://greenkeeper.io/) [![Coverage Status](https://coveralls.io/repos/github/linkedconnections/gtfsrt2lc/badge.svg?branch=master)](https://coveralls.io/github/linkedconnections/gtfsrt2lc?branch=master)
3+
[![Build Status](https://travis-ci.org/linkedconnections/gtfsrt2lc.svg?branch=master)](https://travis-ci.org/linkedconnections/gtfsrt2lc) [![npm](https://img.shields.io/npm/v/gtfsrt2lc.svg?style=popout)](https://npmjs.com/package/gtfsrt2lc) [![Coverage Status](https://coveralls.io/repos/github/linkedconnections/gtfsrt2lc/badge.svg?branch=master)](https://coveralls.io/github/linkedconnections/gtfsrt2lc?branch=master)
44

55
Converts [GTFS-RT](https://developers.google.com/transit/gtfs-realtime/) updates to [Linked Connections](http://linkedconnections.org/) following a predefined URI strategy that is provided using the [RFC 6570](https://tools.ietf.org/html/rfc6570) specification and any variable present in a (also given) related [GTFS](https://developers.google.com/tansit/gtfs/reference/) data source.
66

bin/gtfsrt2json.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env node
22

3-
const fs = require('fs');
43
const Gtfsrt2LC = require('../lib/Gtfsrt2LC');
54
var program = require('commander');
65

lib/Connections2JSONLD.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
const { Transform } = require('stream');
2-
const N3 = require('n3');
3-
const { DataFactory } = N3;
4-
const { namedNode, literal, quad } = DataFactory;
52

63
class Connections2JSONLD extends Transform {
74
constructor(streamContext) {

lib/Gtfsrt2LC.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const fs = require('fs');
66
const zlib = require('zlib');
77
const gtfsrt = require('gtfs-realtime-bindings').transit_realtime;
88
const uri_templates = require('uri-templates');
9-
const jsonldstream = require('jsonld-stream');
9+
const JSONStream = require('JSONStream');
1010
const N3 = require('n3');
1111
const { format, addHours, addMinutes, addSeconds } = require('date-fns');
1212
const Connections2JSONLD = require('./Connections2JSONLD');
@@ -212,7 +212,7 @@ class Gtfsrt2LC {
212212
// Serialize data according to specified format (default: json)
213213
if (options.format === 'jsonld') {
214214
if (!options.objectMode) {
215-
return readable.pipe(new Connections2JSONLD(true)).pipe(new jsonldstream.Serializer());
215+
return readable.pipe(new Connections2JSONLD(true)).pipe(JSONStream.stringify(false));
216216
} else {
217217
return readable.pipe(new Connections2JSONLD(true));
218218
}
@@ -230,7 +230,7 @@ class Gtfsrt2LC {
230230
}));
231231
} else {
232232
if (!options.objectMode) {
233-
return readable.pipe(new jsonldstream.Serializer());
233+
return readable.pipe(JSONStream.stringify(false));
234234
} else {
235235
return readable;
236236
}

0 commit comments

Comments
 (0)