-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from jsertx/feat/is-undefined
feat: isUndefined
- Loading branch information
Showing
7 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
#1.18.0 | ||
- feat: isUndefined | ||
|
||
#1.17.0 | ||
- feat: assignWith | ||
- feat: clone | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict' | ||
|
||
const isUndefined = (val) => { | ||
return val === undefined | ||
} | ||
|
||
module.exports = isUndefined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use strict' | ||
|
||
/* eslint-env mocha */ | ||
const assert = require('assert') | ||
const isUndefined = require('../src/isUndefined') | ||
|
||
describe('isUndefined', () => { | ||
it('should return true for undefined', () => { | ||
assert.ok(isUndefined(undefined)) | ||
}) | ||
|
||
it('should return true for no param', () => { | ||
assert.ok(isUndefined()) | ||
}) | ||
|
||
it('should return false for empty object', () => { | ||
assert.equal(isUndefined({}), false) | ||
}) | ||
|
||
it('should return false for empty array', () => { | ||
assert.equal(isUndefined([]), false) | ||
}) | ||
|
||
it('should return false for null', () => { | ||
assert.equal(isUndefined(null), false) | ||
}) | ||
|
||
it('should return false for false', () => { | ||
assert.equal(isUndefined(false), false) | ||
}) | ||
|
||
it('should return false for empty string', () => { | ||
assert.equal(isUndefined(''), false) | ||
}) | ||
|
||
it('should return false for zero', () => { | ||
assert.equal(isUndefined(0), false) | ||
}) | ||
}) |