oneday-core
Advanced tools
Comparing version 1.0.54 to 1.0.55
{ | ||
"name": "oneday-core", | ||
"version": "1.0.54", | ||
"version": "1.0.55", | ||
"description": "Basic AWS util functions to ease development.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
16
test.js
@@ -35,2 +35,18 @@ var assert = require('chai').assert; | ||
describe('isPresent', function () { | ||
const obj = { | ||
a: 1, | ||
b: null | ||
}; | ||
it('should return true when given obj is present', function () { | ||
assert.isTrue(index.isPresent(obj.a)); | ||
}); | ||
it('should return false when given obj is not present', function () { | ||
assert.isFalse(index.isPresent(null)); | ||
assert.isFalse(index.isPresent(undefined)); | ||
assert.isFalse(index.isPresent(obj.b)); | ||
assert.isFalse(index.isPresent(obj.c)); | ||
}); | ||
}); | ||
describe('isValidEmail', function () { | ||
@@ -37,0 +53,0 @@ it('should return true when given param is a valid email', function () { |
@@ -111,3 +111,3 @@ module.exports.getDynamoDbArn = getDynamoDbArn; | ||
function isPresent(param) { | ||
return param !== undefined; | ||
return param !== undefined && param !== null ; | ||
} | ||
@@ -114,0 +114,0 @@ |
34361
889