-
Notifications
You must be signed in to change notification settings - Fork 5
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 #535 from anantmittal/recent-cutoff-date-undefined
Allow Recent Entry Cutoff to be Undefined
- Loading branch information
Showing
3 changed files
with
99 additions
and
29 deletions.
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
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,20 @@ | ||
import { ok as assert } from "assert"; | ||
|
||
export function assertNotNull<T>( | ||
arg: T, | ||
): asserts arg is Exclude<T, null | undefined> { | ||
assert(arg !== null, "Invalid null"); | ||
} | ||
|
||
export function assertNotUndefined<T>( | ||
arg: T, | ||
): asserts arg is Exclude<T, undefined> { | ||
assert(arg !== undefined, "Invalid undefined"); | ||
} | ||
|
||
export function assertNotNullNotUndefined<T>( | ||
arg: T, | ||
): asserts arg is Exclude<T, null | undefined> { | ||
assertNotNull(arg); | ||
assertNotUndefined(arg); | ||
} |