mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-30 04:47:03 +02:00
NETSCRIPT: Rework script ram updates (#408)
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
// The object properties on these numeric types are for typechecking only and do not exist at runtime. They're just a way to require a typechecking function.
|
||||
export type Integer = number & { __Integer: true };
|
||||
export type PositiveNumber = number & { __Positive: true };
|
||||
export type PositiveInteger = Integer & PositiveNumber;
|
||||
|
||||
// Numeric typechecking functions
|
||||
export const isInteger = (n: unknown): n is Integer => Number.isInteger(n);
|
||||
export const isPositiveInteger = (n: unknown): n is PositiveInteger => isInteger(n) && n > 0;
|
||||
|
||||
/** Status object for functions that return a boolean indicating success/failure
|
||||
* and an optional message */
|
||||
export interface IReturnStatus {
|
||||
|
||||
Reference in New Issue
Block a user