Commit 07bb95ef authored by zeynel's avatar zeynel

Remove redundant check for parameters.

parent c64d71e1
'use strict'; 'use strict';
// TODO Deprecate
var ALLOWED_FIELDS = ['contents', 'included_segments', 'excluded_segments', 'filters', 'include_player_ids', var ALLOWED_FIELDS = ['contents', 'included_segments', 'excluded_segments', 'filters', 'include_player_ids',
'app_id', 'app_ids', 'headings', 'subtitle', 'template_id', 'content_available', 'mutable_content', 'app_id', 'app_ids', 'headings', 'subtitle', 'template_id', 'content_available', 'mutable_content',
'data', 'url', 'ios_attachments', 'big_picture', 'adm_big_picture', 'chrome_big_picture', 'buttons', 'data', 'url', 'ios_attachments', 'big_picture', 'adm_big_picture', 'chrome_big_picture', 'buttons',
...@@ -46,11 +47,9 @@ var Notification = function (initialBody) { ...@@ -46,11 +47,9 @@ var Notification = function (initialBody) {
* @param value * @param value
*/ */
Notification.prototype.setParameter = function (name, value) { Notification.prototype.setParameter = function (name, value) {
// TODO Deprecate
if (name && name[0] === '!') { if (name && name[0] === '!') {
name = name.substring(1); name = name.substring(1);
} else if (ALLOWED_FIELDS.indexOf(name) === -1) {
throw '"' + name + '" is not present in documentation. You should add a ' +
'exclamation mark to the begging of the name, if you want to set it : !' + name;
} }
this.postBody[name] = value; this.postBody[name] = value;
}; };
......
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