Permalink
Browse files

lint.

  • Loading branch information...
1 parent 0743bb6 commit 041215690dafcbbb1533b7bec3caf65a1b5f56db @argon argon committed Feb 24, 2013
Showing with 19 additions and 18 deletions.
  1. +2 −1 .gitignore
  2. +2 −2 lib/connection.js
  3. +14 −14 lib/notification.js
  4. +1 −1 lib/util.js
View
@@ -1 +1,2 @@
-.DS_Store
+.DS_Store
+node_modules
View
@@ -76,7 +76,7 @@ function Connection (options) {
this.notificationBuffer = [];
events.EventEmitter.call(this);
-};
+}
sysu.inherits(Connection, events.EventEmitter);
@@ -101,7 +101,7 @@ Connection.prototype.initialize = function () {
debug("Initialising module");
this.deferredInitialize = q.defer();
- if(this.options.pfx != null || this.options.pfxData != null) {
+ if(this.options.pfx !== null || this.options.pfxData !== null) {
if(this.options.pfxData) {
this.pfxData = this.options.pfxData;
}
View
@@ -38,8 +38,8 @@ Notification.prototype.clone = function (device) {
notification.newsstandAvailable = this.newsstandAvailable;
notification.mdm = this.mdm;
- return notification
-}
+ return notification;
+};
/**
* Set the alert text for the notification
@@ -55,7 +55,7 @@ Notification.prototype.setAlertText = function (text) {
this.prepareAlert();
this.alert['body'] = text;
}
-}
+};
/**
* Set the action-loc-key property on the alert object
@@ -66,7 +66,7 @@ Notification.prototype.setAlertText = function (text) {
Notification.prototype.setActionLocKey = function (key) {
this.prepareAlert();
this.alert['action-loc-key'] = key;
-}
+};
/**
* Set the loc-key parameter on the alert object
@@ -78,10 +78,10 @@ Notification.prototype.setLocKey = function (key) {
this.prepareAlert();
if(!key) {
delete this.alert["loc-key"];
- return
+ return;
}
this.alert['loc-key'] = key;
-}
+};
/**
* Set the loc-args parameter on the alert object
@@ -93,10 +93,10 @@ Notification.prototype.setLocArgs = function (args) {
this.prepareAlert();
if(!args) {
delete this.alert["loc-args"];
- return
+ return;
}
this.alert['loc-args'] = args;
-}
+};
/**
* Set the launch-image parameter on the alert object
@@ -108,10 +108,10 @@ Notification.prototype.setLaunchImage = function (image) {
this.prepareAlert();
if(!image) {
delete this.alert["launch-image"];
- return
+ return;
}
this.alert["launch-image"] = image;
-}
+};
/**
@@ -127,16 +127,15 @@ Notification.prototype.prepareAlert = function () {
this.alert.body = existingValue;
}
}
-}
+};
/**
* @returns {Number} Byte length of the notification payload
- * @private
* @since v1.2.0
*/
Notification.prototype.length = function () {
return Buffer.byteLength(JSON.stringify(this), this.encoding || 'utf8');
-}
+};
/**
* If the notification payload is too long to send this method will attempt to trim the alert body text.
@@ -148,6 +147,7 @@ Notification.prototype.trim = function() {
if(tooLong <= 0) {
return 0;
}
+ var length;
if(typeof this.alert == "string") {
var length = Buffer.byteLength(this.alert, this.encoding || 'utf8');
if (length < tooLong) {
@@ -165,7 +165,7 @@ Notification.prototype.trim = function() {
return tooLong;
}
return -tooLong;
-}
+};
/**
* @private
View
@@ -6,6 +6,6 @@ var extend = function(target) {
}
}
});
-}
+};
module.exports.extend = extend;

0 comments on commit 0412156

Please sign in to comment.