Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Oct 1, 2024
1 parent 212dced commit 480b9d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/lib/control/tilejson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class TileJSON {
try {
url = new URL(str);
} catch (err) {
throw new Err(400, err, 'Invalid URL provided');
throw new Err(400, err instanceof Error ? err : new Error(String(err)), 'Invalid URL provided');
}

if (!['http:', 'https:'].includes(url.protocol)) {
Expand Down
4 changes: 2 additions & 2 deletions api/routes/basemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export default async function router(schema: Schema, config: Config) {
try {
const b = await BasemapParser.parse(String(buffer));

if (!b.basemap.customMapSource) return res.json(imported);
const map = b.basemap.customMapSource;
if (!b.raw.customMapSource) return res.json(imported);
const map = b.raw.customMapSource;

imported.name = map.name._text;
imported.minzoom = map.minZoom._text;
Expand Down
2 changes: 1 addition & 1 deletion api/test/basemap.srv.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ test('PATCH: api/basemap/1 - Invalid URL', async (t) => {

test('DELETE: api/basemap/1', async (t) => {
try {
await flight.fetch('/api/basemap/1', {
const res = await flight.fetch('/api/basemap/1', {
method: 'DELETE',
auth: {
bearer: flight.token.admin
Expand Down

0 comments on commit 480b9d8

Please sign in to comment.