UNPKG

@paroicms/server

Version:
36 lines 717 B
import { Drop } from "liquidjs"; export class ForloopDrop extends Drop { i = 0; name; length; constructor(length, collection, variable) { super(); this.length = length; this.name = `${variable}-${collection}`; } next() { this.i++; } index0() { return this.i; } index() { return this.i + 1; } first() { return this.i === 0; } last() { return this.i === this.length - 1; } rindex() { return this.length - this.i; } rindex0() { return this.length - this.i - 1; } valueOf() { return JSON.stringify(this); } } //# sourceMappingURL=forloop-drop.js.map