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

@ -33,12 +33,12 @@ function Delegator(proto, target) {
* @api public
*/
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);
Delegator.auto = function(proto, targetProto, targetProp) {
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 {
@ -67,12 +67,12 @@ Delegator.auto = function(proto, targetProto, targetProp){
* @api public
*/
Delegator.prototype.method = function(name){
var proto = this.proto;
var target = this.target;
Delegator.prototype.method = function(name) {
let proto = this.proto;
let target = this.target;
this.methods.push(name);
proto[name] = function(){
proto[name] = function() {
return this[target][name].apply(this[target], arguments);
};
@ -87,7 +87,7 @@ Delegator.prototype.method = function(name){
* @api public
*/
Delegator.prototype.access = function(name){
Delegator.prototype.access = function(name) {
return this.getter(name).setter(name);
};
@ -99,12 +99,12 @@ Delegator.prototype.access = function(name){
* @api public
*/
Delegator.prototype.getter = function(name){
var proto = this.proto;
var target = this.target;
Delegator.prototype.getter = function(name) {
let proto = this.proto;
let target = this.target;
this.getters.push(name);
proto.__defineGetter__(name, function(){
proto.__defineGetter__(name, function() {
return this[target][name];
});
@ -119,12 +119,12 @@ Delegator.prototype.getter = function(name){
* @api public
*/
Delegator.prototype.setter = function(name){
var proto = this.proto;
var target = this.target;
Delegator.prototype.setter = function(name) {
let proto = this.proto;
let target = this.target;
this.setters.push(name);
proto.__defineSetter__(name, function(val){
proto.__defineSetter__(name, function(val) {
return this[target][name] = val;
});
@ -139,12 +139,12 @@ Delegator.prototype.setter = function(name){
* @api public
*/
Delegator.prototype.fluent = function (name) {
var proto = this.proto;
var target = this.target;
Delegator.prototype.fluent = function(name) {
let proto = this.proto;
let target = this.target;
this.fluents.push(name);
proto[name] = function(val){
proto[name] = function(val) {
if ('undefined' != typeof val) {
this[target][name] = val;
return this;

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
};
},
/**