smtpapi
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -90,3 +90,3 @@ "use strict"; | ||
smtpapi.prototype.jsonString = function() { | ||
smtpapi.prototype.jsonObject = function() { | ||
var header = {}; | ||
@@ -98,8 +98,14 @@ for (var key in this.header) { | ||
} | ||
var json = JSON.stringify(header); | ||
return escapeUnicode(json); | ||
return header; | ||
} | ||
smtpapi.prototype.jsonString = function() { | ||
var json_object = this.jsonObject(); | ||
var json_string = JSON.stringify(json_object); | ||
return this.escapeUnicode(json_string); | ||
}; | ||
function escapeUnicode(str) { | ||
smtpapi.prototype.escapeUnicode = function(str) { | ||
return str.replace(/[^ -~]|\\/g, function(m0) { | ||
@@ -106,0 +112,0 @@ var code = m0.charCodeAt(0); |
{ | ||
"name": "smtpapi", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Build SendGrid X-SMTPAPI headers in nodejs.", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
@@ -12,3 +12,3 @@ var assert = require('assert'); | ||
it('version should be set', function() { | ||
header.version.should.eql("1.0.0"); | ||
header.version.should.eql("1.0.1"); | ||
}); | ||
@@ -15,0 +15,0 @@ |
12697
191