mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-31 08:25:36 +00:00
misc: Add Nullable<T> helper type
Change-type: minor Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
0505c0f976
commit
d1e1297f6d
@ -10,8 +10,7 @@ export interface CheckIntOptions {
|
|||||||
const ENV_VAR_KEY_REGEX = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
const ENV_VAR_KEY_REGEX = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
||||||
const LABEL_NAME_REGEX = /^[a-zA-Z][a-zA-Z0-9\.\-]*$/;
|
const LABEL_NAME_REGEX = /^[a-zA-Z][a-zA-Z0-9\.\-]*$/;
|
||||||
|
|
||||||
type NullableString = string | undefined | null;
|
type NullableLiteral = Nullable<number | string>;
|
||||||
type NullableLiteral = number | NullableString;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* checkInt
|
* checkInt
|
||||||
|
2
typings/global.d.ts
vendored
2
typings/global.d.ts
vendored
@ -5,3 +5,5 @@ interface Dictionary<T> {
|
|||||||
interface Callback<T> {
|
interface Callback<T> {
|
||||||
(err?: Error, res?: T): void;
|
(err?: Error, res?: T): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Nullable<T> = T | null | undefined;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user