Chore: More linting.

This commit is contained in:
Laur Ivan 2022-03-31 16:00:28 +02:00
parent 85400b46e1
commit a608c5d474

View File

@ -1,9 +1,7 @@
import dotenv from 'dotenv'
import { Client, Database, Query } from 'node-appwrite'
import { Query } from 'node-appwrite'
import { DataPointType } from 'dptlib/lib/DataPointType'
import { DPT } from 'dptlib/lib/definitions'
import { database } from './appwrite'
import type { Models } from 'node-appwrite'
import { DPTAndAddressID, MetricDocument } from './definitions'
@ -32,7 +30,7 @@ export async function getDPTforAddress(destinationAddress: string): Promise<DPTA
// Throw an error if the address is not unique
//
if (list.documents.length != 1) {
throw 'The address is not unique!'
throw new Error('The address is not unique!')
}
// TODO: Move thematcher into the DPT lib as a static function
@ -88,7 +86,7 @@ export async function upsert(record: MetricDocument): Promise<any> {
} else {
logger.error('%j', list_items)
throw 'Multiple entries!'
throw new Error('Multiple entries!')
}
}
@ -134,6 +132,6 @@ export async function upsert1(entry: any) {
}
} else {
throw 'Multiple entries!'
throw new Error('Multiple entries!')
}
}