mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 05:50:43 -07:00
refactor: strictly typed
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import Token from './token'
|
||||
import { last } from 'src/util/underscore'
|
||||
|
||||
export default class DelimitedToken extends Token {
|
||||
trimLeft: boolean
|
||||
trimRight: boolean
|
||||
constructor (raw, value, pos, input, file, line) {
|
||||
super(raw, pos, input, file, line)
|
||||
constructor (raw: string, value: string, input: string, line: number, pos: number, file?: string) {
|
||||
super(raw, input, line, pos, file)
|
||||
this.trimLeft = value[0] === '-'
|
||||
this.trimRight = value[value.length - 1] === '-'
|
||||
this.trimRight = last(value) === '-'
|
||||
this.value = value
|
||||
.slice(
|
||||
this.trimLeft ? 1 : 0,
|
||||
|
||||
Reference in New Issue
Block a user