init commit

This commit is contained in:
rxliuli
2025-11-04 05:03:50 +08:00
commit bce557cc2d
1396 changed files with 172991 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
export type Optional<T> = T | None;
export type None = null | undefined;
/**
* Determine if an optional value is present.
*
* @param optional value
* @return true if present, false otherwise
*/
export function isSome<T>(optional: Optional<T>): optional is T {
return optional !== null && optional !== undefined;
}
/**
* Determine if an optional value is not present.
*
* @param optional value
* @return true if not present, false otherwise
*/
export function isNone<T>(optional: Optional<T>): optional is None {
return optional === null || optional === undefined;
}