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 { return {
subdomainOffset: this.subdomainOffset, subdomainOffset: this.subdomainOffset,
proxy: this.proxy, 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) { assert: function(test, status, message, props) {
if (!test) { 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.status = err.status;
this.length = Buffer.byteLength(msg); this.length = Buffer.byteLength(msg);
res.end(msg); res.end(msg);
}, }
}; };
/** /**

View file

@ -33,12 +33,12 @@ function Delegator(proto, target) {
* @api public * @api public
*/ */
Delegator.auto = function(proto, targetProto, targetProp){ Delegator.auto = function(proto, targetProto, targetProp) {
var delegator = Delegator(proto, targetProp); let delegator = Delegator(proto, targetProp);
var properties = Object.getOwnPropertyNames(targetProto); let properties = Object.getOwnPropertyNames(targetProto);
for (var i = 0; i < properties.length; i++) { for (let i = 0; i < properties.length; i++) {
var property = properties[i]; let property = properties[i];
var descriptor = Object.getOwnPropertyDescriptor(targetProto, property); let descriptor = Object.getOwnPropertyDescriptor(targetProto, property);
if (descriptor.get) { if (descriptor.get) {
delegator.getter(property); delegator.getter(property);
} }
@ -46,7 +46,7 @@ Delegator.auto = function(proto, targetProto, targetProp){
delegator.setter(property); delegator.setter(property);
} }
if (descriptor.hasOwnProperty('value')) { // could be undefined but writable if (descriptor.hasOwnProperty('value')) { // could be undefined but writable
var value = descriptor.value; let value = descriptor.value;
if (value instanceof Function) { if (value instanceof Function) {
delegator.method(property); delegator.method(property);
} else { } else {
@ -67,12 +67,12 @@ Delegator.auto = function(proto, targetProto, targetProp){
* @api public * @api public
*/ */
Delegator.prototype.method = function(name){ Delegator.prototype.method = function(name) {
var proto = this.proto; let proto = this.proto;
var target = this.target; let target = this.target;
this.methods.push(name); this.methods.push(name);
proto[name] = function(){ proto[name] = function() {
return this[target][name].apply(this[target], arguments); return this[target][name].apply(this[target], arguments);
}; };
@ -87,7 +87,7 @@ Delegator.prototype.method = function(name){
* @api public * @api public
*/ */
Delegator.prototype.access = function(name){ Delegator.prototype.access = function(name) {
return this.getter(name).setter(name); return this.getter(name).setter(name);
}; };
@ -99,12 +99,12 @@ Delegator.prototype.access = function(name){
* @api public * @api public
*/ */
Delegator.prototype.getter = function(name){ Delegator.prototype.getter = function(name) {
var proto = this.proto; let proto = this.proto;
var target = this.target; let target = this.target;
this.getters.push(name); this.getters.push(name);
proto.__defineGetter__(name, function(){ proto.__defineGetter__(name, function() {
return this[target][name]; return this[target][name];
}); });
@ -119,12 +119,12 @@ Delegator.prototype.getter = function(name){
* @api public * @api public
*/ */
Delegator.prototype.setter = function(name){ Delegator.prototype.setter = function(name) {
var proto = this.proto; let proto = this.proto;
var target = this.target; let target = this.target;
this.setters.push(name); this.setters.push(name);
proto.__defineSetter__(name, function(val){ proto.__defineSetter__(name, function(val) {
return this[target][name] = val; return this[target][name] = val;
}); });
@ -139,12 +139,12 @@ Delegator.prototype.setter = function(name){
* @api public * @api public
*/ */
Delegator.prototype.fluent = function (name) { Delegator.prototype.fluent = function(name) {
var proto = this.proto; let proto = this.proto;
var target = this.target; let target = this.target;
this.fluents.push(name); this.fluents.push(name);
proto[name] = function(val){ proto[name] = function(val) {
if ('undefined' != typeof val) { if ('undefined' != typeof val) {
this[target][name] = val; this[target][name] = val;
return this; return this;

View file

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

View file

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