showStorage.js 321 Bytes
/**
 * 显示剩余库存
 * @param  {[Number]} leftNumber
 * @return {[boolen]}
 */
module.exports = function(leftNumber) {
    leftNumber = +leftNumber;

    if (leftNumber <= 3 && leftNumber >= 0) {
        return '仅剩' + leftNumber + '件';
    } else if (leftNumber < 0) {
        return '库存不足';
    }
};