Code coverage report for lib/inTraderItem.js

Statements: 97.22% (35 / 36)      Branches: 80% (32 / 40)      Functions: 100% (6 / 6)      Lines: 97.22% (35 / 36)      Ignored: none     

All files » lib/ » inTraderItem.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77    1 29               29       29 42 28 23     42     29 286 27 25 2 2 1   1           286     29 54 26 26     54     29 11 2 1     1       11     29 40 27 27     40       1 1    
'use strict';
 
function inTraderItem() {
    var ID = 0,
        qty = 0,
        price = 0,
        weight = 0,
        itemNumber = '';
 
    /*{'ID' : [] ,'artNr' : 'product_1', 'price': 12.5, 'weight': 120}*/
 
    for (var i = 0, j = arguments.length; i < j; i++){
        //document.write(arguments[i]+' ');
    }
 
    this.ID = function(val) {
        if(val) {
            if(typeof val == 'number' || val instanceof Number) {
                ID = val;
            }
        }
        return ID;
    }
 
    this.price = function(val) {
        if(val) {
            if(typeof val == 'number' || val instanceof Number) {
                price = val;
            } else Eif(typeof val == 'string' || val instanceof String) {
                if (parseFloat(val)) {
                    price = parseFloat(val);
                } else {
                    price = 0;
                }
 
 
            }
        }
        return price;
    }
 
    this.weight = function(val) {
        if(val) {
            Eif(typeof val == 'number' || val instanceof Number) {
                weight = val;
            }
        }
        return weight;
    }
 
    this.qty = function(val) {
        if(val) {
            if(typeof val == 'number' || val instanceof Number) {
                Iif (val > 0 ) {
                    qty = val;
                } else {
                    qty = 0;
                }
            }
        }
        return qty;
    }
 
    this.itemNumber = function(val) {
        if(val) {
            Eif(typeof val == 'string' || val instanceof String) {
                itemNumber = val;
            }
        }
        return itemNumber;
    }
}
 
Eif (typeof module !== 'undefined') {
    module.exports = inTraderItem;
}