@sussudio/base
Version:
Internal APIs for VS Code's utilities and user interface building blocks.
13 lines (12 loc) • 545 B
JavaScript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/**
* @returns Returns a random port between 1025 and 65535.
*/
export function randomPort() {
const min = 1025;
const max = 65535;
return min + Math.floor((max - min) * Math.random());
}