mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 21:00:40 -07:00
feat: implement forloop.name as found in ruby shopify/liquid
This commit is contained in:
@@ -2,10 +2,12 @@ import { Drop } from './drop'
|
||||
|
||||
export class ForloopDrop extends Drop {
|
||||
protected i = 0
|
||||
public name: string
|
||||
public length: number
|
||||
public constructor (length: number) {
|
||||
public constructor (length: number, collection: string, variable: string) {
|
||||
super()
|
||||
this.length = length
|
||||
this.name = `${variable}-${collection}`
|
||||
}
|
||||
public next () {
|
||||
this.i++
|
||||
|
||||
Reference in New Issue
Block a user