@stiava/cta 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -148,12 +148,21 @@ var CTABusService = class {
148
148
 
149
149
  // cta_system_data.ts
150
150
  var Papa = __toESM(require("papaparse"), 1);
151
+ var import_node_fs = require("fs");
152
+ var import_node_url = require("url");
153
+ var import_node_path = __toESM(require("path"), 1);
154
+ var import_meta = {};
155
+ var __dirname = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
151
156
  var CTASystemGuide = class {
152
157
  static getTrainLines() {
153
158
  return ["Red", "Green", "Pink", "Blue", "Purple", "Orange", "Brown"];
154
159
  }
155
160
  static readInTrainStationsByRoute(line) {
156
- const result = Papa.parse(`./public/trains/${line}_stations.csv`, {
161
+ const csvFilePath = (0, import_node_fs.readFileSync)(
162
+ import_node_path.default.join(__dirname, "public", "trains", `${line}_stations.csv`),
163
+ "utf8"
164
+ );
165
+ const result = Papa.parse(csvFilePath, {
157
166
  header: true,
158
167
  dynamicTyping: true,
159
168
  skipEmptyLines: true,
package/dist/index.js CHANGED
@@ -111,12 +111,20 @@ var CTABusService = class {
111
111
 
112
112
  // cta_system_data.ts
113
113
  import * as Papa from "papaparse";
114
+ import { readFileSync } from "fs";
115
+ import { fileURLToPath } from "url";
116
+ import path from "path";
117
+ var __dirname = path.dirname(fileURLToPath(import.meta.url));
114
118
  var CTASystemGuide = class {
115
119
  static getTrainLines() {
116
120
  return ["Red", "Green", "Pink", "Blue", "Purple", "Orange", "Brown"];
117
121
  }
118
122
  static readInTrainStationsByRoute(line) {
119
- const result = Papa.parse(`./public/trains/${line}_stations.csv`, {
123
+ const csvFilePath = readFileSync(
124
+ path.join(__dirname, "public", "trains", `${line}_stations.csv`),
125
+ "utf8"
126
+ );
127
+ const result = Papa.parse(csvFilePath, {
120
128
  header: true,
121
129
  dynamicTyping: true,
122
130
  skipEmptyLines: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stiava/cta",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "A NodeJS package for interacting with the CTA Bus and Train apis",
5
5
  "license": "MIT",
6
6
  "type": "module",