• 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

75.51
/lib/db/mappedColumn.ts
1
import { GeoPackageDataType } from './geoPackageDataType';
1✔
2

3
/**
4
 * Mapped column, to a column and potentially from a differently named column
5
 */
6
export class MappedColumn {
1✔
7
  /**
8
   * To column
9
   */
10
  _toColumn: string;
11

12
  /**
13
   * From column or null if the same as to column
14
   */
15
  _fromColumn: string;
16

17
  /**
18
   * Default to column value
19
   */
20
  _defaultValue: any;
21

22
  /**
23
   * Column data type
24
   */
25
  _dataType: GeoPackageDataType;
26

27
  /**
28
   * Constant value
29
   */
30
  _constantValue: any;
31

32
  /**
33
   * Where value
34
   */
35
  _whereValue: any;
36

37
  /**
38
   * Where value comparison operator (=, <, etc)
39
   */
40
  _whereOperator: string;
41

42
  /**
43
   * Constructor
44
   *
45
   * @param toColumn to column
46
   * @param fromColumn from column
47
   * @param defaultValue default value
48
   * @param dataType data type
49
   */
50
  constructor(toColumn: string, fromColumn: string, defaultValue: any, dataType: GeoPackageDataType) {
51
    this._toColumn = toColumn;
232✔
52
    this._fromColumn = fromColumn;
232✔
53
    this._defaultValue = defaultValue;
232✔
54
    this._dataType = dataType;
232✔
55
  }
56

57
  /**
58
   * Get the to column
59
   * @return to column
60
   */
61
  get toColumn(): string {
1✔
62
    return this._toColumn;
232✔
63
  }
64

65
  /**
66
   * Set the to column
67
   * @param toColumn to column
68
   */
69
  set toColumn(toColumn: string) {
70
    this._toColumn = toColumn;
×
71
  }
72

73
  /**
74
   * Determine if the column has a new name
75
   *
76
   * @return true if the to and from column names are different
77
   */
78
  hasNewName(): boolean {
1✔
79
    return this._fromColumn != null && this._fromColumn !== this._toColumn;
805✔
80
  }
81

82
  /**
83
   * Get the from column
84
   * @return from column
85
   */
86
  get fromColumn(): string {
1✔
87
    return this._fromColumn;
207✔
88
  }
89

90
  /**
91
   * Set the from column
92
   * @param fromColumn to column
93
   */
94
  set fromColumn(fromColumn: string) {
95
    this._fromColumn = fromColumn;
×
96
  }
97

98
  /**
99
   * Check if the column has a default value
100
   * @return true if has a default value
101
   */
102
  hasDefaultValue(): boolean {
1✔
103
    return this._defaultValue != null;
350✔
104
  }
105

106
  /**
107
   * Get the default value
108
   * @return default value
109
   */
110
  get defaultValue(): any {
1✔
111
    return this._defaultValue;
×
112
  }
113

114
  /**
115
   * Set the default value
116
   * @param defaultValue default value
117
   */
118
  set defaultValue(defaultValue: any) {
119
    this._defaultValue = defaultValue;
×
120
  }
121

122
  /**
123
   * Get the default value as a string
124
   * @return default value as string
125
   */
126
  getDefaultValueAsString(): string {
1✔
127
    return GeoPackageDataType.columnDefaultValue(this._defaultValue, this._dataType);
57✔
128
  }
129

130
  /**
131
   * Get the data type
132
   * @return data type
133
   */
134
  get dataType(): GeoPackageDataType {
1✔
135
    return this._dataType;
×
136
  }
137

138
  /**
139
   * Set the data type
140
   * @param dataType data type
141
   */
142
  set dataType(dataType: GeoPackageDataType) {
143
    this._dataType = dataType;
×
144
  }
145

146
  /**
147
   * Check if the column has a constant value
148
   * @return true if has a constant value
149
   */
150
  hasConstantValue(): boolean {
1✔
151
    return this._constantValue != null;
203✔
152
  }
153

154
  /**
155
   * Get the constant value
156
   * @return constant value
157
   */
158
  get constantValue(): any {
1✔
159
    return this._constantValue;
×
160
  }
161

162
  /**
163
   * Set the constant value
164
   * @param constantValue constant value
165
   */
166
  set constantValue(constantValue: any) {
167
    this._constantValue = constantValue;
28✔
168
  }
169

170
  /**
171
   * Get the constant value as a string
172
   * @return constant value as string
173
   */
174
  getConstantValueAsString(): string {
1✔
175
    return GeoPackageDataType.columnDefaultValue(this._constantValue, this._dataType);
28✔
176
  }
177

178
  /**
179
   * Check if the column has a where value
180
   * @return true if has a where value
181
   */
182
  hasWhereValue(): boolean {
1✔
183
    return this._whereValue != null;
203✔
184
  }
185

186
  /**
187
   * Get the where value
188
   * @return where value
189
   */
190
  get whereValue(): any {
1✔
191
    return this._whereValue;
×
192
  }
193

194
  /**
195
   * Set the where value
196
   * @param whereValue where value
197
   */
198
  set whereValue(whereValue: any) {
199
    this._whereValue = whereValue;
32✔
200
  }
201

202
  /**
203
   * Get the where value as a string
204
   * @return where value as string
205
   */
206
  getWhereValueAsString(): string {
1✔
207
    return GeoPackageDataType.columnDefaultValue(this._whereValue, this._dataType);
32✔
208
  }
209

210
  /**
211
   * Set the where value
212
   * @param whereValue where value
213
   * @param whereOperator where operator
214
   */
215
  setWhereValueAndOperator(whereValue: any, whereOperator: string): void {
1✔
216
    this._whereValue = whereValue;
×
217
    this.whereOperator = whereOperator;
×
218
  }
219

220
  /**
221
   * Get the where operator
222
   * @return where operator
223
   */
224
  get whereOperator(): string {
1✔
225
    return this._whereOperator != null ? this._whereOperator : '=';
32!
226
  }
227

228
  /**
229
   * Set the where operator
230
   * @param whereOperator where operator
231
   */
232
  set whereOperator(whereOperator: string) {
233
    this._whereOperator = whereOperator;
×
234
  }
235
}
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