0.3.0原版
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
|
||||
export const normalizePort = (val: string) => {
|
||||
const port = parseInt(val, 10);
|
||||
if (isNaN(port)) {
|
||||
// named pipe
|
||||
return val;
|
||||
}
|
||||
if (port >= 0) {
|
||||
// port number
|
||||
return port;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export const waitMs = (ms: number) => {
|
||||
return new Promise(resolve => {
|
||||
setTimeout(resolve, ms);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user