Skip to content

Commit

Permalink
lodash removed, tests passing
Browse files Browse the repository at this point in the history
  • Loading branch information
LandRover committed Feb 3, 2016
1 parent 3ddbfcd commit fe085f6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/message/confirmation_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ConfirmationModel {
* @return {Object} message formated with the values extracted from the payload received.
*/
_initConfirmationModel(payload) {
if (!_.isArray(payload)) {return null;} // if not an array.. return.
if (!Array.isArray(payload)) {return null;} // if not an array.. return.

let confirmation = this.getDefaultConfirmation();

Expand Down
3 changes: 1 addition & 2 deletions src/message/heartbeat_model.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

const _ = require('lodash'),
TYPES = require('./../consts/types'),
const TYPES = require('./../consts/types'),
IDENTIFIERS = require('../consts/identifiers');


Expand Down
2 changes: 1 addition & 1 deletion src/message/message_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MessageBase {
* @return {Object} Symbol referance of that type.
*/
getType() {
return _.isNil(this.type) ? TYPES.UNKNOWN : this.type;
return 'undefined' === typeof this.type || null === this.type ? TYPES.UNKNOWN : this.type;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/message/message_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MessageModel extends MessageBase {
* @return {Object} message formated with the values extracted from the payload received.
*/
_initMessageModel(payload) {
if (!_.isArray(payload)) {return null;} // if not an array.. return.
if (!Array.isArray(payload)) {return null;} // if not an array.. return.

let message = this.getDefaultMessage();

Expand Down
4 changes: 1 addition & 3 deletions src/payload/payload_base.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

const _ = require('lodash');

/**
* BasePayload.
*
Expand Down Expand Up @@ -43,7 +41,7 @@ class BasePayload {
let matchPattern = this.regexMatch();

// create a model, if match found.
if (_.isArray(matchPattern)) {
if (Array.isArray(matchPattern)) {
matchPattern.shift();

return this.initializeModel(matchPattern);
Expand Down

0 comments on commit fe085f6

Please sign in to comment.