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,15 +8,12 @@ import { readFile } from 'fs-promise'
// =================================================================== // ===================================================================
function bind (fn, thisArg) { const bind = (fn, thisArg) => function () {
return function () {
return fn.apply(thisArg, arguments) return fn.apply(thisArg, arguments)
}
} }
const VAR_RE = /\{\{([^}]+)\}\}/g const VAR_RE = /\{\{([^}]+)\}\}/g
function evalFilter (filter, vars) { const evalFilter = (filter, vars) => filter.replace(VAR_RE, (_, name) => {
return filter.replace(VAR_RE, (_, name) => {
const value = vars[name] const value = vars[name]
if (value === undefined) { if (value === undefined) {
@ -24,8 +21,7 @@ function evalFilter (filter, vars) {
} }
return escape(value) return escape(value)
}) })
}
export const configurationSchema = { export const configurationSchema = {
type: 'object', type: 'object',