Merge pull request #89 from sigv/lint-lib-1609

Lint lib/
This commit is contained in:
Ian Webster 2016-09-20 09:08:39 -07:00 committed by GitHub
commit 2162a47038
2 changed files with 10 additions and 17 deletions

View File

@ -221,15 +221,12 @@ module.exports = {
escotel: [ escotel: [
'%s@escotelmobile.com', '%s@escotelmobile.com',
], ],
surewestcommunications: [ sunrisecommunications: [
'%s@freesurf.ch', '%s@freesurf.ch',
], ],
teliadenmark: [ teliadenmark: [
'%s@gsm1800.telia.dk', '%s@gsm1800.telia.dk',
], ],
ideacellular: [
'%s@ideacellular.net',
],
itelcel: [ itelcel: [
'%s@itelcel.com', '%s@itelcel.com',
], ],
@ -283,9 +280,6 @@ module.exports = {
oneconnectaustria: [ oneconnectaustria: [
'%s@onemail.at', '%s@onemail.at',
], ],
onlinebeep: [
'%s@onlinebeep.net',
],
optusmobile: [ optusmobile: [
'%s@optusmobile.com.au', '%s@optusmobile.com.au',
], ],

View File

@ -1,9 +1,7 @@
var providers = require('./providers.js') var providers = require('./providers.js'),
, _ = require('underscore') carriers = require('./carriers.js'),
, carriers = require('./carriers.js') spawn = require('child_process').spawn,
, exec = require('child_process').exec StringDecoder = require('string_decoder').StringDecoder;
, spawn = require('child_process').spawn;
var StringDecoder = require('string_decoder').StringDecoder;
var debugEnabled = false; var debugEnabled = false;
@ -44,6 +42,7 @@ function debug(enable) {
Params: Params:
phone - phone number to text phone - phone number to text
message - message to send message - message to send
carrier - carrier to use (may be null)
region - region to use (defaults to US) region - region to use (defaults to US)
cb - function(err), provides err messages cb - function(err), provides err messages
*/ */
@ -53,10 +52,10 @@ function sendText(phone, message, carrier, region, cb) {
region = region || 'us'; region = region || 'us';
var providers_list; var providers_list;
if (carrier == null) { if (carrier !== null) {
providers_list = providers[region];
} else {
providers_list = carriers[carrier]; providers_list = carriers[carrier];
} else {
providers_list = providers[region];
} }
var emails = providers_list.map(function(provider) { var emails = providers_list.map(function(provider) {
@ -79,7 +78,7 @@ function sendText(phone, message, carrier, region, cb) {
child.on('exit', function(code, signal) { child.on('exit', function(code, signal) {
cb(false); cb(false);
}); });
console.log(message); output(message);
child.stdin.write(message); child.stdin.write(message);
child.stdin.end(); child.stdin.end();
} }