Closed sdenel closed 7 years ago
This is pretty pointless in this case.
'cache'
and 'serverInfo'
are defined strings not some unknown values provided by the client.So for example this
if ('cache' in this.options) {
if (typeof(this.options.cache) === 'number') {
this.cache = this.options.cache;
} else if (! this.options.cache) {
this.cache = false;
}
}
could be
if (typeof this.options.cache === 'number' || this.options.cache === false) {
this.cache = this.options.cache;
}
Change based on a JSLint advice, and on this thread: http://stackoverflow.com/questions/13632999/if-key-in-object-or-ifobject-hasownpropertykey See also a speed test: http://andrew.hedges.name/experiments/in/