-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
44 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- '0.10' | ||
- '0.8' | ||
before_script: | ||
- npm install -g grunt-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* ultrases | ||
* http://dev.paticon.com/module/ultrases | ||
* | ||
* Copyright (c) 2014 Yotam Tanay | ||
* Licensed under the MIT license. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
exports.checkRequiredParams = function checkRequiredParams(config) { | ||
if(!config.aws){ | ||
throw new TypeError('you must pass an AWS config object to the constructor in the form of {accessKeyId, secretAccessKey, region}'); | ||
} | ||
var required = {'accessKeyId': 'string', 'secretAccessKey': 'string'}; | ||
for(var prop in required){ | ||
if(typeof config.aws[prop] !== required[prop]){ | ||
throw new TypeError('\'' + prop + '\' must be of type ' + required[prop] + ' (currently ' + typeof config[prop] + ')'); | ||
} | ||
} | ||
}; | ||
|
||
exports.checkRequiredParamsSend = function checkRequiredParamsSend(params) { | ||
var props = {from: 'string', to: 'array', cc: 'array', bcc: 'array', subject: 'string', text: 'string', html: 'string', replyTo: 'array', returnPath: 'string'}; | ||
for(var prop in props){ | ||
if(props[prop] === 'array'){ | ||
if(!Array.isArray(params[prop])){ | ||
throw new TypeError('\'' + prop + '\' must be of array'); | ||
} | ||
} else { | ||
if(typeof params[prop] !== props[prop]){ | ||
throw new TypeError('\'' + prop + '\' must be of ' + props[prop]); | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters