Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let target = targets.find(target => {
return testValue(target, {
request: {
method: [ ctx.method, undefined ],
accepts: type => ctx.accepts(type)
}
})
})
/* else take the first target without a request (no request means 'all requests') */
if (!target) {
target = targets.find(target => !target.request)
}
if (target) {
if (t.isFunction(target.response)) {
const pathMatches = ctx.path.match(pathRe).slice(1)
return target.response.apply(null, [ctx].concat(pathMatches))
} else if (t.isPlainObject(target.response)) {
Object.assign(ctx.response, target.response)
} else {
throw new Error(`Invalid response: ${JSON.stringify(target.response)}`)
}
}
} else {
return next()
}
}
}
get: function get() {
var cellValue = _value.get(this);
if (t.isFunction(cellValue)) cellValue = cellValue.call(_column.get(this));
if (cellValue === undefined) {
cellValue = '';
} else {
cellValue = String(cellValue);
}
return cellValue;
}
}]);
isBoolean () {
return this.type === Boolean || (t.isFunction(this.type) && this.type.name === 'Boolean')
}
isMultiple () {
value: function isBoolean() {
if (this.type) {
return this.type === Boolean || t.isFunction(this.type) && this.type.name === 'Boolean';
} else {
return false;
}
}
}]);