chore: fix linting

This commit is contained in:
harttle
2019-02-23 03:50:45 +08:00
parent 56c7992b76
commit 3cf01603e8
35 changed files with 107 additions and 110 deletions
+1 -2
View File
@@ -1,5 +1,4 @@
import * as _ from './underscore'
import { __extends } from 'tslib'
import Token from 'src/parser/token'
import ITemplate from 'src/template/itemplate'
@@ -11,7 +10,7 @@ abstract class LiquidError extends Error {
this.originalError = err
this.token = token
}
protected update() {
protected update () {
const err = this.originalError
const context = mkContext(this.token)
this.message = mkMessage(err.message, this.token)
+2 -2
View File
@@ -5,8 +5,8 @@
* The iteratee is invoked with three arguments: (value, index, iterable).
*/
export function mapSeries<T1, T2> (
iterable: T1[],
iteratee: (item: T1, idx: number, iterable: T1[]) => Promise<T2> | T2
iterable: T1[],
iteratee: (item: T1, idx: number, iterable: T1[]) => Promise<T2> | T2
): Promise<T2[]> {
let ret = Promise.resolve(0)
const result: T2[] = []
+1 -1
View File
@@ -179,6 +179,6 @@ export default function (d: Date, format: string) {
// Add the format code
const ch = results[0].charAt(1)
const func = formatCodes[ch]
output += func ? func.call(null, d) : '%' + ch
output += func ? func(d) : '%' + ch
}
}
+2 -2
View File
@@ -77,10 +77,10 @@ export function isError (value: any): boolean {
* @param {Function} iteratee The function invoked per iteration.
* @return {Object} Returns object.
*/
export function forOwn <T>(
export function forOwn <T> (
object: {[key: string]: T} | undefined,
iteratee: ((val: T, key: string, obj: {[key: string]: T}) => boolean | void)
) {
) {
object = object || {}
for (const k in object) {
if (object.hasOwnProperty(k)) {