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