Skip to content

Commit

Permalink
Returning to the identity operator
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Mar 31, 2015
1 parent 3a1fd62 commit a136811
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions lib/tenso.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Tenso {
};
}

if ( typeof fn == "function" ) {
if ( typeof fn === "function" ) {
this.rates[ id ] = fn( req, this.rates[ id ] );
}

Expand Down Expand Up @@ -222,7 +222,7 @@ class Tenso {
ref[ 0 ][ "cache-control" ] = clone( this.server.config.headers[ "cache-control" ], true );
}

if ( ref[ 0 ][ "cache-control" ] !== undefined && ref[ 0 ][ "cache-control" ].indexOf( "private " ) == -1 ) {
if ( ref[ 0 ][ "cache-control" ] !== undefined && ref[ 0 ][ "cache-control" ].indexOf( "private " ) === -1 ) {
ref[ 0 ][ "cache-control" ] = "private " + ref[ 0 ][ "cache-control" ];
}
}
Expand Down Expand Up @@ -749,7 +749,7 @@ let bootstrap = ( obj, config ) => {
if ( config.routes instanceof Object ) {
iterate( config.routes, ( routes, method ) => {
iterate( routes, ( arg, route ) => {
if ( typeof arg == "function" ) {
if ( typeof arg === "function" ) {
obj.server[ method ]( route, (...args) => {
arg.apply( obj, args );
} );
Expand Down Expand Up @@ -929,7 +929,7 @@ let hypermedia = ( server, req, rep, headers ) => {
array.iterate( rep.data.result, ( i ) => {
let uri;

if ( typeof i == "string" && REGEX.scheme.test( i ) ) {
if ( typeof i === "string" && REGEX.scheme.test( i ) ) {
uri = i.indexOf( "//" ) > -1 ? i : protocol + "//" + req.parsed.host + i;

if ( uri !== root ) {
Expand Down Expand Up @@ -988,7 +988,7 @@ let keymaster = ( req, res, next ) => {
if ( uri in routes ) {
result = routes[ uri ];

if ( typeof result == "function" ) {
if ( typeof result === "function" ) {
result.call( obj, req, res );
} else {
obj.respond( req, res, result );
Expand All @@ -1005,7 +1005,7 @@ let keymaster = ( req, res, next ) => {
} );

if ( result ) {
if ( typeof result == "function" ) {
if ( typeof result === "function" ) {
result.call( obj, req, res );
} else {
obj.respond( req, res, result );
Expand Down
12 changes: 6 additions & 6 deletions lib/tenso.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ var Tenso = (function () {
};
}

if (typeof fn == "function") {
if (typeof fn === "function") {
this.rates[id] = fn(req, this.rates[id]);
}

Expand Down Expand Up @@ -249,7 +249,7 @@ var Tenso = (function () {
ref[0]["cache-control"] = clone(this.server.config.headers["cache-control"], true);
}

if (ref[0]["cache-control"] !== undefined && ref[0]["cache-control"].indexOf("private ") == -1) {
if (ref[0]["cache-control"] !== undefined && ref[0]["cache-control"].indexOf("private ") === -1) {
ref[0]["cache-control"] = "private " + ref[0]["cache-control"];
}
}
Expand Down Expand Up @@ -791,7 +791,7 @@ var bootstrap = function (obj, config) {
if (config.routes instanceof Object) {
iterate(config.routes, function (routes, method) {
iterate(routes, function (arg, route) {
if (typeof arg == "function") {
if (typeof arg === "function") {
obj.server[method](route, function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
Expand Down Expand Up @@ -981,7 +981,7 @@ var hypermedia = function (server, req, rep, headers) {
array.iterate(rep.data.result, function (i) {
var uri = undefined;

if (typeof i == "string" && REGEX.scheme.test(i)) {
if (typeof i === "string" && REGEX.scheme.test(i)) {
uri = i.indexOf("//") > -1 ? i : protocol + "//" + req.parsed.host + i;

if (uri !== root) {
Expand Down Expand Up @@ -1043,7 +1043,7 @@ var keymaster = function (req, res, next) {
if (uri in routes) {
result = routes[uri];

if (typeof result == "function") {
if (typeof result === "function") {
result.call(obj, req, res);
} else {
obj.respond(req, res, result);
Expand All @@ -1060,7 +1060,7 @@ var keymaster = function (req, res, next) {
});

if (result) {
if (typeof result == "function") {
if (typeof result === "function") {
result.call(obj, req, res);
} else {
obj.respond(req, res, result);
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ let bootstrap = ( obj, config ) => {
if ( config.routes instanceof Object ) {
iterate( config.routes, ( routes, method ) => {
iterate( routes, ( arg, route ) => {
if ( typeof arg == "function" ) {
if ( typeof arg === "function" ) {
obj.server[ method ]( route, (...args) => {
arg.apply( obj, args );
} );
Expand Down
4 changes: 2 additions & 2 deletions src/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Tenso {
};
}

if ( typeof fn == "function" ) {
if ( typeof fn === "function" ) {
this.rates[ id ] = fn( req, this.rates[ id ] );
}

Expand Down Expand Up @@ -155,7 +155,7 @@ class Tenso {
ref[ 0 ][ "cache-control" ] = clone( this.server.config.headers[ "cache-control" ], true );
}

if ( ref[ 0 ][ "cache-control" ] !== undefined && ref[ 0 ][ "cache-control" ].indexOf( "private " ) == -1 ) {
if ( ref[ 0 ][ "cache-control" ] !== undefined && ref[ 0 ][ "cache-control" ].indexOf( "private " ) === -1 ) {
ref[ 0 ][ "cache-control" ] = "private " + ref[ 0 ][ "cache-control" ];
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/hypermedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ let hypermedia = ( server, req, rep, headers ) => {
array.iterate( rep.data.result, ( i ) => {
let uri;

if ( typeof i == "string" && REGEX.scheme.test( i ) ) {
if ( typeof i === "string" && REGEX.scheme.test( i ) ) {
uri = i.indexOf( "//" ) > -1 ? i : protocol + "//" + req.parsed.host + i;

if ( uri !== root ) {
Expand Down
4 changes: 2 additions & 2 deletions src/keymaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let keymaster = ( req, res, next ) => {
if ( uri in routes ) {
result = routes[ uri ];

if ( typeof result == "function" ) {
if ( typeof result === "function" ) {
result.call( obj, req, res );
} else {
obj.respond( req, res, result );
Expand All @@ -39,7 +39,7 @@ let keymaster = ( req, res, next ) => {
} );

if ( result ) {
if ( typeof result == "function" ) {
if ( typeof result === "function" ) {
result.call( obj, req, res );
} else {
obj.respond( req, res, result );
Expand Down

0 comments on commit a136811

Please sign in to comment.