Skip to content

Commit

Permalink
fix: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sciator committed Sep 12, 2023
1 parent f368bf4 commit 8238186
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
5 changes: 2 additions & 3 deletions packages/client/src/InfluxDBClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ export default class InfluxDBClient {
async *queryPoints(
query: string,
database: string,
queryType: QueryType,
measurement: string
queryType: QueryType
): AsyncGenerator<PointValues, void, void> {
const points = this._queryApi.queryPoints(
query,
Expand All @@ -90,7 +89,7 @@ export default class InfluxDBClient {
)

for await (const point of points) {
yield point.setMeasurement(measurement)
yield point
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/Point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class Point {
*/
public static fromValues(values: PointValues): Point {
if (!values.getMeasurement() || values.getMeasurement() === '') {
throw new Error('cannot convert values to point without measurement set!')
throw new Error('Cannot convert values to point without measurement set!')
}
return new Point(values)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/PointValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export class PointValues {
if (!fieldEntry) return undefined
const [actualType, value] = fieldEntry
if (type !== undefined && type !== actualType)
throw new GetFieldTypeMissmatchError(name, actualType, type)
throw new GetFieldTypeMissmatchError(name, type, actualType)
return value
}

Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/integration/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('e2e test', () => {
row = await data.next()
expect(row.done).to.equal(true)

const dataPoints = client.queryPoints(query, database, queryType, 'stat')
const dataPoints = client.queryPoints(query, database, queryType)

let pointRow: IteratorResult<PointValues, void>
pointRow = await dataPoints.next()
Expand Down
5 changes: 4 additions & 1 deletion packages/client/test/unit/util/point.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ describe('point', () => {
}).to.throw(`uint value for field 'fails' out of range: -1`)

expect(() => {
Point.measurement('a').setUintegerField('fails', Number.MAX_SAFE_INTEGER + 10)
Point.measurement('a').setUintegerField(
'fails',
Number.MAX_SAFE_INTEGER + 10
)
}).to.throw(
`uint value for field 'fails' out of range: ${
Number.MAX_SAFE_INTEGER + 10
Expand Down

0 comments on commit 8238186

Please sign in to comment.