refactor: strictly typed

This commit is contained in:
harttle
2019-02-23 00:49:54 +08:00
parent 51f7e66f60
commit 5b6100d12b
86 changed files with 2630 additions and 2590 deletions
+4 -3
View File
@@ -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,