Fix linter errors
This commit is contained in:
parent
46b43d831b
commit
bd05c21456
5 changed files with 34 additions and 34 deletions
|
@ -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
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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);
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -34,11 +34,11 @@ function Delegator(proto, target) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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 {
|
||||||
|
@ -68,8 +68,8 @@ Delegator.auto = function(proto, targetProto, targetProp){
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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() {
|
||||||
|
@ -100,8 +100,8 @@ Delegator.prototype.access = function(name){
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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() {
|
||||||
|
@ -120,8 +120,8 @@ Delegator.prototype.getter = function(name){
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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) {
|
||||||
|
@ -140,8 +140,8 @@ Delegator.prototype.setter = function(name){
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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) {
|
||||||
|
|
|
@ -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
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue