Commit 286229ae by Sebastián Katzer

Even more type checking

parent e6041089
......@@ -520,19 +520,25 @@ exports.mergeWithDefaults = function (options) {
*/
exports.convertProperties = function (options) {
if (options.date === undefined || options.date === null) {
options.date = new Date();
}
options.id = options.id.toString();
options.title = options.title.toString();
options.message = options.message.toString();
options.autoCancel = options.autoCancel === true;
if (isNaN(options.id)) {
options.id = this.getDefaults().id;
}
if (isNaN(options.badge)) {
options.badge = this.getDefaults().badge;
}
options.badge = Number(options.badge);
if (options.date === undefined || options.date === null) {
options.date = new Date();
}
if (typeof options.date == 'object') {
options.date = Math.round(options.date.getTime()/1000);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment