Update for suggestions made at typpo/textbelt pull request #94
This commit is contained in:
		@@ -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
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user