Use arrow funcs where possible.

This commit is contained in:
Julien Fontanet 2015-12-28 10:18:21 +01:00
parent faf5ff6aa4
commit a6e18819d4

View File

@ -8,24 +8,20 @@ import { readFile } from 'fs-promise'
// ===================================================================
function bind (fn, thisArg) {
return function () {
return fn.apply(thisArg, arguments)
}
const bind = (fn, thisArg) => function () {
return fn.apply(thisArg, arguments)
}
const VAR_RE = /\{\{([^}]+)\}\}/g
function evalFilter (filter, vars) {
return filter.replace(VAR_RE, (_, name) => {
const value = vars[name]
const evalFilter = (filter, vars) => filter.replace(VAR_RE, (_, name) => {
const value = vars[name]
if (value === undefined) {
throw new Error('invalid variable: ' + name)
}
if (value === undefined) {
throw new Error('invalid variable: ' + name)
}
return escape(value)
})
}
return escape(value)
})
export const configurationSchema = {
type: 'object',