Update for suggestions made at typpo/textbelt pull request #94

This commit is contained in:
Timothy Willard 2016-12-02 21:20:40 -05:00
parent 60b4b8d6ec
commit 7f8c2feb51

View File

@ -75,15 +75,10 @@ function sendText(phone, message, carrier, region, cb) {
obj - object of config properties to be overriden
*/
function setConfig(obj) {
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
config[prop] = obj[prop];
}
}
config = Object.assign(config, obj);
}
module.exports = {
send: sendText, // Send a text message
// debug: debug, No longer needed, see setConfig and config.js
config: setConfig // Override default config
};