From 126f29032f4333f6a30e1ed8c2a96276173fe25c Mon Sep 17 00:00:00 2001 From: aditya menon Date: Sat, 3 Jan 2015 03:38:08 +0530 Subject: [PATCH] Update truevault.js + Reduced code that checks whether the callback is a valid function. + Random variable called 'percentage' has been corrected: I hope I'm right to think this was a typo :) + Reduced code for type safety check in `method`. --- truevault.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/truevault.js b/truevault.js index 4fed52b..09a08ae 100644 --- a/truevault.js +++ b/truevault.js @@ -64,13 +64,13 @@ var tvExplorer = { //An action could be handled globally with the //tvExplorer.apiRequestDone function of or via this callback //for more specific action. - if (typeof (callback) === "undefined" || typeof (callback) === "object") { + if (typeof (callback) !== "function") { callback = function() { }; } //default method to GET - method = (typeof (method) === "undefined" || typeof (percentage) === "object") ? "GET" : method; + method = (typeof (method) !== "string") ? "GET" : method; if (typeof (params) !== "undefined" && typeof (params) !== "object") {