diff --git a/.eslintrc b/.eslintrc index 9ed6072..327f804 100644 --- a/.eslintrc +++ b/.eslintrc @@ -4,20 +4,25 @@ "mocha": true }, "rules": { - "strict": [2, "safe"], - "no-mixed-requires": 0, - "no-multi-spaces": 0, - "space-infix-ops": 2, - "quotes": [1, "single"], - "vars-on-top": 1, - "one-var": 1, - "no-shadow": 0, - "eol-last": 0, - "key-spacing": 0, + "strict": [2, "global"], + "no-mixed-requires": [0], + "no-multi-spaces": [0], + "space-infix-ops": [2], + "quotes": [2, "single"], + "vars-on-top": [2], + "one-var": [2], + "no-shadow": [0], + "eol-last": [0], + "key-spacing": [0], "no-mixed-spaces-and-tabs": [2, "smart-tabs"], "space-unary-ops": [1, { "words": true, "nonwords": true }], - "no-underscore-dangle": 0, - "camelcase": 0, - "no-process-exit": 0 + "no-underscore-dangle": [0], + "camelcase": [0], + "no-process-exit": [0], + "no-use-before-define": [0], + "no-unused-expressions": [2], + "semi": [2, "always"], + "no-unused-vars": [2], + "comma-spacing": [2, {"before": false, "after": true}] } } \ No newline at end of file diff --git a/lib/session.js b/lib/session.js index 1d04743..8474a89 100644 --- a/lib/session.js +++ b/lib/session.js @@ -372,15 +372,14 @@ function longSms(pduObj) { // reference number is of one octet otherwise it consists of 2 octets. Other fields can // be found from below reference. // reference: https://en.wikipedia.org/wiki/Concatenated_SMS - var udhHeaderSize = pduObj.params.short_message[0], // First octet is the size of UDH Header - headerSize = pduObj.params.short_message[2], // Header size other than first 2 octets - csmsReference = pduObj.params.short_message.slice(3, 3 + headerSize - 2), // CSMS Reference starts from - // 4th octet and length is - // header size -2 octets - partsCount = pduObj.params.short_message[2 + csmsReference.length + 1], - partNr = pduObj.params.short_message[2 + csmsReference.length + 1]; - - var longSmsId = pduObj.params.source_addr + '_' + pduObj.params.destination_addr + '_' + csmsReference; + var udhHeaderSize = pduObj.params.short_message[0], // First octet is the size of UDH Header + headerSize = pduObj.params.short_message[2], // Header size other than first 2 octets + csmsReference = pduObj.params.short_message.slice(3, 3 + headerSize - 2), // CSMS Reference starts from + // 4th octet and length is + // header size -2 octets + partsCount = pduObj.params.short_message[2 + csmsReference.length + 1], + partNr = pduObj.params.short_message[2 + csmsReference.length + 1], + longSmsId = pduObj.params.source_addr + '_' + pduObj.params.destination_addr + '_' + csmsReference; if (this.longSmses[longSmsId] === undefined) { this.longSmses[longSmsId] = {