-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
818d625
commit 9f3a6d7
Showing
5 changed files
with
45 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* @file Type Tests - isUndefined | ||
* @module tutils/guards/tests/unit-d/isUndefined | ||
*/ | ||
|
||
import type testSubject from '../is-undefined' | ||
|
||
describe('unit-d:guards/isUndefined', () => { | ||
it('should guard undefined', () => { | ||
expectTypeOf<typeof testSubject>().guards.toBeUndefined() | ||
}) | ||
}) |
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,16 @@ | ||
/** | ||
* @file Unit Tests - isUndefined | ||
* @module tutils/guards/tests/unit/isUndefined | ||
*/ | ||
|
||
import testSubject from '../is-undefined' | ||
|
||
describe('unit:guards/isUndefined', () => { | ||
it('should return false if value is not undefined', () => { | ||
expect(testSubject(faker.datatype.array())).to.be.false | ||
}) | ||
|
||
it('should return true if value is undefined', () => { | ||
expect(testSubject(undefined)).to.be.true | ||
}) | ||
}) |
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,14 @@ | ||
/** | ||
* @file Type Guards - isUndefined | ||
* @module tutils/guards/isUndefined | ||
*/ | ||
|
||
/** | ||
* Checks if the given `value` is `undefined`. | ||
* | ||
* @param {unknown} value - Value to evaluate | ||
* @return {value is undefined} `true` if `value` is `undefined` | ||
*/ | ||
const isUndefined = (value: unknown): value is undefined => value === undefined | ||
|
||
export default isUndefined |