mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-24 07:39:36 +02:00
Replaced require with static imports
This commit is contained in:
parent
46e21f8d75
commit
e425d9b012
15 changed files with 15 additions and 55 deletions
|
@ -1,7 +1,5 @@
|
||||||
import {createRequire} from 'module';
|
import dbnavBase from '../dbnav/base.json' with { type: "json" };
|
||||||
const require = createRequire(import.meta.url);
|
import dbregioguideBase from '../dbregioguide/base.json' with { type: "json" };
|
||||||
const dbnavBase = require('../dbnav/base.json');
|
|
||||||
const dbregioguideBase = require('../dbregioguide/base.json');
|
|
||||||
import {products} from '../../lib/products.js';
|
import {products} from '../../lib/products.js';
|
||||||
|
|
||||||
// journeys()
|
// journeys()
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
import {createRequire} from 'module';
|
import baseProfile from './base.json' with { type: "json" };
|
||||||
const require = createRequire(import.meta.url);
|
|
||||||
|
|
||||||
const baseProfile = require('./base.json');
|
|
||||||
import {products} from '../../lib/products.js';
|
import {products} from '../../lib/products.js';
|
||||||
import {formatJourneysReq, formatRefreshJourneyReq} from './journeys-req.js';
|
import {formatJourneysReq, formatRefreshJourneyReq} from './journeys-req.js';
|
||||||
import {formatTripReq} from './trip-req.js';
|
import {formatTripReq} from './trip-req.js';
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import {createRequire} from 'module';
|
import baseProfile from './base.json' with { type: "json" };
|
||||||
const require = createRequire(import.meta.url);
|
|
||||||
const baseProfile = require('./base.json');
|
|
||||||
import {products} from '../../lib/products.js';
|
import {products} from '../../lib/products.js';
|
||||||
import {formatTripReq} from './trip-req.js';
|
import {formatTripReq} from './trip-req.js';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
import {createRequire} from 'module';
|
import baseProfile from './base.json' with { type: "json" };
|
||||||
const require = createRequire(import.meta.url);
|
|
||||||
|
|
||||||
const baseProfile = require('./base.json');
|
|
||||||
import {products} from '../../lib/products.js';
|
import {products} from '../../lib/products.js';
|
||||||
import {formatJourneysReq, formatRefreshJourneyReq} from './journeys-req.js';
|
import {formatJourneysReq, formatRefreshJourneyReq} from './journeys-req.js';
|
||||||
import {formatLocationFilter} from './location-filter.js';
|
import {formatLocationFilter} from './location-filter.js';
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
// todo: use import assertions once they're supported by Node.js & ESLint
|
// todo: use import assertions once they're supported by Node.js & ESLint
|
||||||
// https://github.com/tc39/proposal-import-assertions
|
// https://github.com/tc39/proposal-import-assertions
|
||||||
import {createRequire} from 'module';
|
|
||||||
const require = createRequire(import.meta.url);
|
|
||||||
|
|
||||||
import tap from 'tap';
|
import tap from 'tap';
|
||||||
|
|
||||||
import {createClient} from '../index.js';
|
import {createClient} from '../index.js';
|
||||||
import {profile as rawProfile} from '../p/dbnav/index.js';
|
import {profile as rawProfile} from '../p/dbnav/index.js';
|
||||||
const res = require('./fixtures/dbnav-departures.json');
|
import res from './fixtures/dbnav-departures.json' with { type: "json" };
|
||||||
import {dbnavDepartures as expected} from './fixtures/dbnav-departures.js';
|
import {dbnavDepartures as expected} from './fixtures/dbnav-departures.js';
|
||||||
|
|
||||||
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
// todo: use import assertions once they're supported by Node.js & ESLint
|
// todo: use import assertions once they're supported by Node.js & ESLint
|
||||||
// https://github.com/tc39/proposal-import-assertions
|
// https://github.com/tc39/proposal-import-assertions
|
||||||
import {createRequire} from 'module';
|
|
||||||
const require = createRequire(import.meta.url);
|
|
||||||
|
|
||||||
import tap from 'tap';
|
import tap from 'tap';
|
||||||
|
|
||||||
import {createClient} from '../index.js';
|
import {createClient} from '../index.js';
|
||||||
import {profile as rawProfile} from '../p/dbnav/index.js';
|
import {profile as rawProfile} from '../p/dbnav/index.js';
|
||||||
const res = require('./fixtures/dbnav-refresh-journey.json');
|
import res from './fixtures/dbnav-refresh-journey.json' with { type: "json" };
|
||||||
import {dbNavJourney as expected} from './fixtures/dbnav-refresh-journey.js';
|
import {dbNavJourney as expected} from './fixtures/dbnav-refresh-journey.js';
|
||||||
|
|
||||||
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
// todo: use import assertions once they're supported by Node.js & ESLint
|
// todo: use import assertions once they're supported by Node.js & ESLint
|
||||||
// https://github.com/tc39/proposal-import-assertions
|
// https://github.com/tc39/proposal-import-assertions
|
||||||
import {createRequire} from 'module';
|
|
||||||
const require = createRequire(import.meta.url);
|
|
||||||
|
|
||||||
import tap from 'tap';
|
import tap from 'tap';
|
||||||
|
|
||||||
import {createClient} from '../index.js';
|
import {createClient} from '../index.js';
|
||||||
import {profile as rawProfile} from '../p/dbnav/index.js';
|
import {profile as rawProfile} from '../p/dbnav/index.js';
|
||||||
const res = require('./fixtures/dbnav-stop.json');
|
import res from './fixtures/dbnav-stop.json' with { type: "json" };
|
||||||
import {dbnavDepartures as expected} from './fixtures/dbnav-stop.js';
|
import {dbnavDepartures as expected} from './fixtures/dbnav-stop.js';
|
||||||
|
|
||||||
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
// todo: use import assertions once they're supported by Node.js & ESLint
|
// todo: use import assertions once they're supported by Node.js & ESLint
|
||||||
// https://github.com/tc39/proposal-import-assertions
|
// https://github.com/tc39/proposal-import-assertions
|
||||||
import {createRequire} from 'module';
|
|
||||||
const require = createRequire(import.meta.url);
|
|
||||||
|
|
||||||
import tap from 'tap';
|
import tap from 'tap';
|
||||||
|
|
||||||
import {createClient} from '../index.js';
|
import {createClient} from '../index.js';
|
||||||
import {profile as rawProfile} from '../p/dbnav/index.js';
|
import {profile as rawProfile} from '../p/dbnav/index.js';
|
||||||
const res = require('./fixtures/dbnav-trip.json');
|
import res from './fixtures/dbnav-trip.json' with { type: "json" };
|
||||||
import {dbTrip as expected} from './fixtures/dbnav-trip.js';
|
import {dbTrip as expected} from './fixtures/dbnav-trip.js';
|
||||||
|
|
||||||
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
// todo: use import assertions once they're supported by Node.js & ESLint
|
// todo: use import assertions once they're supported by Node.js & ESLint
|
||||||
// https://github.com/tc39/proposal-import-assertions
|
// https://github.com/tc39/proposal-import-assertions
|
||||||
import {createRequire} from 'module';
|
|
||||||
const require = createRequire(import.meta.url);
|
|
||||||
|
|
||||||
import tap from 'tap';
|
import tap from 'tap';
|
||||||
|
|
||||||
import {createClient} from '../index.js';
|
import {createClient} from '../index.js';
|
||||||
import {profile as rawProfile} from '../p/dbregioguide/index.js';
|
import {profile as rawProfile} from '../p/dbregioguide/index.js';
|
||||||
const res = require('./fixtures/dbregioguide-trip.json');
|
import res from './fixtures/dbregioguide-trip.json' with { type: "json" };
|
||||||
import {dbTrip as expected} from './fixtures/dbregioguide-trip.js';
|
import {dbTrip as expected} from './fixtures/dbregioguide-trip.js';
|
||||||
|
|
||||||
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
// todo: use import assertions once they're supported by Node.js & ESLint
|
// todo: use import assertions once they're supported by Node.js & ESLint
|
||||||
// https://github.com/tc39/proposal-import-assertions
|
// https://github.com/tc39/proposal-import-assertions
|
||||||
import {createRequire} from 'module';
|
|
||||||
const require = createRequire(import.meta.url);
|
|
||||||
|
|
||||||
import tap from 'tap';
|
import tap from 'tap';
|
||||||
|
|
||||||
import {createClient} from '../index.js';
|
import {createClient} from '../index.js';
|
||||||
import {profile as rawProfile} from '../p/dbweb/index.js';
|
import {profile as rawProfile} from '../p/dbweb/index.js';
|
||||||
const res = require('./fixtures/dbris-arrivals.json');
|
import res from './fixtures/dbris-arrivals.json' with { type: "json" };
|
||||||
import {dbArrivals as expected} from './fixtures/dbris-arrivals.js';
|
import {dbArrivals as expected} from './fixtures/dbris-arrivals.js';
|
||||||
|
|
||||||
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
// todo: use import assertions once they're supported by Node.js & ESLint
|
// todo: use import assertions once they're supported by Node.js & ESLint
|
||||||
// https://github.com/tc39/proposal-import-assertions
|
// https://github.com/tc39/proposal-import-assertions
|
||||||
import {createRequire} from 'module';
|
|
||||||
const require = createRequire(import.meta.url);
|
|
||||||
|
|
||||||
import tap from 'tap';
|
import tap from 'tap';
|
||||||
|
|
||||||
import {createClient} from '../index.js';
|
import {createClient} from '../index.js';
|
||||||
import {profile as rawProfile} from '../p/dbweb/index.js';
|
import {profile as rawProfile} from '../p/dbweb/index.js';
|
||||||
const res = require('./fixtures/dbweb-departures.json');
|
import res from './fixtures/dbweb-departures.json' with { type: "json" };
|
||||||
import {dbwebDepartures as expected} from './fixtures/dbweb-departures.js';
|
import {dbwebDepartures as expected} from './fixtures/dbweb-departures.js';
|
||||||
|
|
||||||
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: true});
|
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: true});
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
// todo: use import assertions once they're supported by Node.js & ESLint
|
// todo: use import assertions once they're supported by Node.js & ESLint
|
||||||
// https://github.com/tc39/proposal-import-assertions
|
// https://github.com/tc39/proposal-import-assertions
|
||||||
import {createRequire} from 'module';
|
|
||||||
const require = createRequire(import.meta.url);
|
|
||||||
|
|
||||||
import tap from 'tap';
|
import tap from 'tap';
|
||||||
|
|
||||||
import {createClient} from '../index.js';
|
import {createClient} from '../index.js';
|
||||||
import {profile as rawProfile} from '../p/dbweb/index.js';
|
import {profile as rawProfile} from '../p/dbweb/index.js';
|
||||||
const res = require('./fixtures/dbweb-journey.json');
|
import res from './fixtures/dbweb-journey.json' with { type: "json" };
|
||||||
import {dbwebJourney as expected} from './fixtures/dbweb-journey.js';
|
import {dbwebJourney as expected} from './fixtures/dbweb-journey.js';
|
||||||
|
|
||||||
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
// todo: use import assertions once they're supported by Node.js & ESLint
|
// todo: use import assertions once they're supported by Node.js & ESLint
|
||||||
// https://github.com/tc39/proposal-import-assertions
|
// https://github.com/tc39/proposal-import-assertions
|
||||||
import {createRequire} from 'module';
|
|
||||||
const require = createRequire(import.meta.url);
|
|
||||||
|
|
||||||
import tap from 'tap';
|
import tap from 'tap';
|
||||||
|
|
||||||
import {createClient} from '../index.js';
|
import {createClient} from '../index.js';
|
||||||
import {profile as rawProfile} from '../p/dbweb/index.js';
|
import {profile as rawProfile} from '../p/dbweb/index.js';
|
||||||
const res = require('./fixtures/dbweb-refresh-journey.json');
|
import res from './fixtures/dbweb-refresh-journey.json' with { type: "json" };
|
||||||
import {dbJourney as expected} from './fixtures/dbweb-refresh-journey.js';
|
import {dbJourney as expected} from './fixtures/dbweb-refresh-journey.js';
|
||||||
|
|
||||||
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
// todo: use import assertions once they're supported by Node.js & ESLint
|
// todo: use import assertions once they're supported by Node.js & ESLint
|
||||||
// https://github.com/tc39/proposal-import-assertions
|
// https://github.com/tc39/proposal-import-assertions
|
||||||
import {createRequire} from 'module';
|
|
||||||
const require = createRequire(import.meta.url);
|
|
||||||
|
|
||||||
import tap from 'tap';
|
import tap from 'tap';
|
||||||
|
|
||||||
import {createClient} from '../index.js';
|
import {createClient} from '../index.js';
|
||||||
import {profile as rawProfile} from '../p/dbweb/index.js';
|
import {profile as rawProfile} from '../p/dbweb/index.js';
|
||||||
const res = require('./fixtures/dbweb-trip.json');
|
import res from './fixtures/dbweb-trip.json' with { type: "json" };
|
||||||
import {dbwebTrip as expected} from './fixtures/dbweb-trip.js';
|
import {dbwebTrip as expected} from './fixtures/dbweb-trip.js';
|
||||||
|
|
||||||
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
const client = createClient(rawProfile, 'public-transport/hafas-client:test', {enrichStations: false});
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
// todo: use import assertions once they're supported by Node.js & ESLint
|
// todo: use import assertions once they're supported by Node.js & ESLint
|
||||||
// https://github.com/tc39/proposal-import-assertions
|
// https://github.com/tc39/proposal-import-assertions
|
||||||
import {createRequire} from 'module';
|
|
||||||
const require = createRequire(import.meta.url);
|
|
||||||
|
|
||||||
import tap from 'tap';
|
import tap from 'tap';
|
||||||
import {
|
import {
|
||||||
checkIfResponseIsOk as checkIfResIsOk,
|
checkIfResponseIsOk as checkIfResIsOk,
|
||||||
|
|
Loading…
Add table
Reference in a new issue