mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 01:25:38 -05:00
* remove some unnecessary sql carbon edits to vs source and adds correct fix where necessary * revert bad change
21 lines
677 B
TypeScript
21 lines
677 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
export function clamp(value: number, min: number, max: number): number {
|
|
return Math.min(Math.max(value, min), max);
|
|
}
|
|
|
|
export function rot(index: number, modulo: number): number {
|
|
return (modulo + (index % modulo)) % modulo;
|
|
}
|
|
|
|
export class Counter {
|
|
private _next = 0;
|
|
|
|
getNext(): number {
|
|
return this._next++;
|
|
}
|
|
}
|