summaryrefslogtreecommitdiffstats
path: root/lib/sendgrid.js
diff options
context:
space:
mode:
authorAdam Buczynski <adambuczynski@gmail.com>2016-07-27 11:47:08 +1200
committerAdam Buczynski <adambuczynski@gmail.com>2016-07-27 11:47:08 +1200
commitea4e9fd24a7cd715f24027cc34f588cc64597682 (patch)
treeeedc3c853fa30dcbd376cef0d2dafc43cae3c39e /lib/sendgrid.js
parente2b95bda9e57702a34d912fa468a1e3b7e14832e (diff)
downloadsendgrid-nodejs-ea4e9fd24a7cd715f24027cc34f588cc64597682.zip
sendgrid-nodejs-ea4e9fd24a7cd715f24027cc34f588cc64597682.tar.gz
sendgrid-nodejs-ea4e9fd24a7cd715f24027cc34f588cc64597682.tar.bz2
Doc comments
Diffstat (limited to 'lib/sendgrid.js')
-rw-r--r--lib/sendgrid.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/sendgrid.js b/lib/sendgrid.js
index de6ee46..d497058 100644
--- a/lib/sendgrid.js
+++ b/lib/sendgrid.js
@@ -5,7 +5,9 @@ var emptyRequest = require('sendgrid-rest').emptyRequest;
var Client = require('sendgrid-rest').Client;
var SendGridError = require('./helpers/error');
-//Helper to check if response is valid
+/**
+ * Helper to check if response is valid
+ */
function isValidResponse(response) {
return (
response &&
@@ -15,7 +17,9 @@ function isValidResponse(response) {
);
}
-//Helper to get a new empty request
+/**
+ * Helper to get a new empty request
+ */
function getEmptyRequest(data) {
let request = JSON.parse(JSON.stringify(emptyRequest));
if (data && typeof data === 'object') {
@@ -28,7 +32,9 @@ function getEmptyRequest(data) {
return request;
}
-//Helper to make headers
+/**
+ * Helper to make headers
+ */
function makeHeaders(apiKey, globalHeaders) {
var headers = {};
headers['Authorization'] = 'Bearer '.concat(apiKey);
@@ -49,7 +55,9 @@ function makeHeaders(apiKey, globalHeaders) {
return headers;
}
-//SendGrid allows for quick and easy access to the v3 Web API
+/**
+ * SendGrid allows for quick and easy access to the v3 Web API
+ */
function SendGrid(apiKey, host, globalHeaders) {
//Create global request