Skip to content

Commit a0543f0

Browse files
authored
Chore: fix code example with explicit encoding (#192)
Resolves a typescript error, namely `"Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'string'.ts"`
1 parent 07e9cf8 commit a0543f0

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ import { readFile } from 'fs/promises';
6969
import path from 'node:path';
7070

7171
const config = JSON.parse(
72-
await readFile(path.join(import.meta.dirname, 'config.json'))
72+
await readFile(path.join(import.meta.dirname, 'config.json'), 'utf8')
7373
);
7474

7575
try {
@@ -531,7 +531,7 @@ import { readFile } from 'fs/promises';
531531
import path from 'node:path';
532532

533533
const config = JSON.parse(
534-
await readFile(path.join(import.meta.dirname, 'config.json'))
534+
await readFile(path.join(import.meta.dirname, 'config.json'), 'utf8')
535535
);
536536

537537
await importGtfs(config);
@@ -577,7 +577,7 @@ import { readFile } from 'fs/promises';
577577
import path from 'node:path';
578578

579579
const config = JSON.parse(
580-
await readFile(path.join(import.meta.dirname, 'config.json'))
580+
await readFile(path.join(import.meta.dirname, 'config.json'), 'utf8')
581581
);
582582

583583
await updateGtfsRealtime(config);
@@ -660,7 +660,7 @@ import { readFile } from 'fs/promises';
660660
import path from 'node:path';
661661

662662
const config = JSON.parse(
663-
await readFile(path.join(import.meta.dirname, 'config.json'))
663+
await readFile(path.join(import.meta.dirname, 'config.json'), 'utf8')
664664
);
665665

666666
const db = openDb(config);
@@ -702,7 +702,7 @@ import { readFile } from 'fs/promises';
702702
import path from 'node:path';
703703

704704
const config = JSON.parse(
705-
await readFile(path.join(import.meta.dirname, 'config.json'))
705+
await readFile(path.join(import.meta.dirname, 'config.json'), 'utf8')
706706
);
707707

708708
const db = openDb(config);
@@ -724,7 +724,7 @@ import { readFile } from 'fs/promises';
724724
import path from 'node:path';
725725

726726
const config = JSON.parse(
727-
await readFile(path.join(import.meta.dirname, 'config.json'))
727+
await readFile(path.join(import.meta.dirname, 'config.json'), 'utf8')
728728
);
729729

730730
const db = openDb(config);
@@ -746,7 +746,7 @@ import { readFile } from 'fs/promises';
746746
import path from 'node:path';
747747

748748
const config = JSON.parse(
749-
await readFile(path.join(import.meta.dirname, 'config.json'))
749+
await readFile(path.join(import.meta.dirname, 'config.json'), 'utf8')
750750
);
751751
const db = openDb(config);
752752
const stops = getStops(

0 commit comments

Comments
 (0)