Skip to content

Commit 9aad631

Browse files
committed
Minor refactor
1 parent 5ec6f7f commit 9aad631

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/datasource.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ export class DataSource extends DataSourceApi<JsonApiQuery, JsonApiDataSourceOpt
6262
});
6363

6464
const fieldLengths = fields.map(field => field.values.length);
65+
const uniqueFieldLengths = Array.from(new Set(fieldLengths)).length;
6566

6667
// All fields need to have the same length for the data frame to be valid.
67-
if (Array.from(new Set(fieldLengths)).length > 1) {
68+
if (uniqueFieldLengths > 1) {
6869
throw new Error('Fields have different lengths');
6970
}
7071

0 commit comments

Comments
 (0)