• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ngageoint / geopackage-js / 4078143969

pending completion
4078143969

push

github

Christopher Caldwell
bump version

3593 of 8015 branches covered (44.83%)

Branch coverage included in aggregate %.

15102 of 20471 relevant lines covered (73.77%)

1564.55 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.45
/lib/attributes/attributesTable.ts
1
import { UserTable } from '../user/userTable';
1✔
2
import { Contents } from '../contents/contents';
3
import { AttributesColumn } from './attributesColumn';
4
import { AttributesColumns } from './attributesColumns';
1✔
5
import { ContentsDataType } from '../contents/contentsDataType';
1✔
6
import { GeoPackageException } from '../geoPackageException';
1✔
7
import { UserColumns } from '../user/userColumns';
8

9
/**
10
 * Represents a user attribute table
11
 */
12
export class AttributesTable extends UserTable<AttributesColumn> {
1✔
13
  contents: Contents;
14

15
  constructor(tableName: string, columns: AttributesColumn[]) {
16
    super(new AttributesColumns(tableName, columns, false));
3,037✔
17
  }
18

19
  /**
20
   * Set the contents
21
   * @param  {Contents} contents the contents
22
   */
23
  setContents(contents: Contents): boolean {
1✔
24
    this.contents = contents;
3,191✔
25
    if (contents.getDataType() !== ContentsDataType.ATTRIBUTES) {
3,191✔
26
      throw new GeoPackageException(
1✔
27
        `The Contents of an Attributes Table must have a data type of ${ContentsDataType.ATTRIBUTES}`,
28
      );
29
    }
30
    return true;
3,190✔
31
  }
32

33
  copy(): UserTable<AttributesColumn> {
1✔
34
    return new AttributesTable(this.getTableName(), this.columns.getColumns());
×
35
  }
36

37
  createUserColumns(columns: AttributesColumn[]): UserColumns<AttributesColumn> {
1✔
38
    return new AttributesColumns(this.getTableName(), columns, true);
1,365✔
39
  }
40

41
  getDataType(): string {
1✔
42
    return this.getDataTypeOrDefault(ContentsDataType.nameFromType(ContentsDataType.ATTRIBUTES));
59✔
43
  }
44
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc