Fix linter errors

This commit is contained in:
Jonatan Nilsson 2019-10-11 17:46:53 +00:00
parent 46b43d831b
commit bd05c21456
5 changed files with 34 additions and 34 deletions

View file

@ -82,8 +82,8 @@ module.exports = class Application extends Emitter {
return {
subdomainOffset: this.subdomainOffset,
proxy: this.proxy,
env: this.env,
}
env: this.env
};
}
/**

View file

@ -66,7 +66,7 @@ const proto = module.exports = {
assert: function(test, status, message, props) {
if (!test) {
this.throw(status, message, props)
this.throw(status, message, props);
}
},
@ -153,7 +153,7 @@ const proto = module.exports = {
this.status = err.status;
this.length = Buffer.byteLength(msg);
res.end(msg);
},
}
};
/**

View file

@ -34,11 +34,11 @@ function Delegator(proto, target) {
*/
Delegator.auto = function(proto, targetProto, targetProp) {
var delegator = Delegator(proto, targetProp);
var properties = Object.getOwnPropertyNames(targetProto);
for (var i = 0; i < properties.length; i++) {
var property = properties[i];
var descriptor = Object.getOwnPropertyDescriptor(targetProto, property);
let delegator = Delegator(proto, targetProp);
let properties = Object.getOwnPropertyNames(targetProto);
for (let i = 0; i < properties.length; i++) {
let property = properties[i];
let descriptor = Object.getOwnPropertyDescriptor(targetProto, property);
if (descriptor.get) {
delegator.getter(property);
}
@ -46,7 +46,7 @@ Delegator.auto = function(proto, targetProto, targetProp){
delegator.setter(property);
}
if (descriptor.hasOwnProperty('value')) { // could be undefined but writable
var value = descriptor.value;
let value = descriptor.value;
if (value instanceof Function) {
delegator.method(property);
} else {
@ -68,8 +68,8 @@ Delegator.auto = function(proto, targetProto, targetProp){
*/
Delegator.prototype.method = function(name) {
var proto = this.proto;
var target = this.target;
let proto = this.proto;
let target = this.target;
this.methods.push(name);
proto[name] = function() {
@ -100,8 +100,8 @@ Delegator.prototype.access = function(name){
*/
Delegator.prototype.getter = function(name) {
var proto = this.proto;
var target = this.target;
let proto = this.proto;
let target = this.target;
this.getters.push(name);
proto.__defineGetter__(name, function() {
@ -120,8 +120,8 @@ Delegator.prototype.getter = function(name){
*/
Delegator.prototype.setter = function(name) {
var proto = this.proto;
var target = this.target;
let proto = this.proto;
let target = this.target;
this.setters.push(name);
proto.__defineSetter__(name, function(val) {
@ -140,8 +140,8 @@ Delegator.prototype.setter = function(name){
*/
Delegator.prototype.fluent = function(name) {
var proto = this.proto;
var target = this.target;
let proto = this.proto;
let target = this.target;
this.fluents.push(name);
proto[name] = function(val) {

View file

@ -567,8 +567,8 @@ module.exports = {
return {
method: this.method,
url: this.url,
header: this.header,
}
header: this.header
};
}
};

View file

@ -306,7 +306,7 @@ module.exports = {
*/
set type(orgType) {
let type = orgType
let type = orgType;
if (!type) {
this.remove('Content-Type');
return;
@ -317,7 +317,7 @@ module.exports = {
// supported mime types.
if (type.indexOf('/') > 0 || type.indexOf(';') > 0) {
if (type.indexOf(';') === -1 && type.indexOf('text') >= 0) {
type += '; charset=utf-8'
type += '; charset=utf-8';
}
this.set('Content-Type', type);
} else if (type.indexOf('json') >= 0 || type.indexOf('css.map') >= 0 || type.indexOf('js.map') >= 0) {
@ -565,8 +565,8 @@ module.exports = {
return {
status: this.status,
message: this.message,
header: this.header,
}
header: this.header
};
},
/**