soda-angular
Version:
Socrata SODA client for Angular
16 lines (15 loc) • 438 B
JavaScript
export class OrderClause {
constructor(...columns) {
if (!columns || columns.length === 0) {
throw new Error("At least one column must be provided");
}
this.Columns = columns;
Object.freeze(this.Columns);
}
toString() {
if (this.Columns && this.Columns.length > 0) {
return `$order=${this.Columns.join(",")}`;
}
return "";
}
}