soda-angular
Version:
Socrata SODA client for Angular
18 lines (17 loc) • 428 B
JavaScript
export class OffsetClause {
constructor(rows) {
if (rows < 0) {
throw new Error("Rows must be 0 or greater");
}
if (!Number.isInteger(rows)) {
throw new Error("Rows must be a whole number");
}
this.Rows = rows;
}
toString() {
if (this.Rows > 0) {
return `$offset=${this.Rows}`;
}
return "";
}
}