easysql/node_modules/monaco-editor/esm/vs/base/common/uint.js
2025-12-29 18:35:04 +08:00

25 lines
764 B
JavaScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
function toUint8(v) {
if (v < 0) {
return 0;
}
if (v > 255 /* Constants.MAX_UINT_8 */) {
return 255 /* Constants.MAX_UINT_8 */;
}
return v | 0;
}
function toUint32(v) {
if (v < 0) {
return 0;
}
if (v > 4294967295 /* Constants.MAX_UINT_32 */) {
return 4294967295 /* Constants.MAX_UINT_32 */;
}
return v | 0;
}
export { toUint32, toUint8 };