-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
279 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
type FalsyCheckValue = Array<unknown> | Record<string | number | symbol, unknown> | boolean | string | number | null | undefined; | ||
type Checker<T> = ((value: T) => FalsyCheckValue) | ((value: T) => Promise<FalsyCheckValue>) | FalsyCheckValue | Promise<FalsyCheckValue>; | ||
interface CheckMap<T> { | ||
[key: string]: Checker<T>; | ||
} | ||
interface SyncCheckMap { | ||
[key: string]: ((value: any) => FalsyCheckValue) | FalsyCheckValue; | ||
} | ||
type CheckResult<C extends CheckMap<any>> = C extends SyncCheckMap ? boolean : Promise<boolean>; | ||
export declare function check<C extends CheckMap<any>>(checkers: C): CheckResult<C>; | ||
export declare function check<T, C extends CheckMap<T>>(value: T, checkers: C): CheckResult<C>; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { check } from './check.ts'; | ||
import { parseDuration } from './stages.js'; | ||
import { getCurrentStageIndex } from './stages.js'; | ||
import { tagWithCurrentStageIndex } from './stages.js'; | ||
import { tagWithCurrentStageProfile } from './stages.js'; | ||
import { findBetween } from './utils.js'; | ||
import { normalDistributionStages } from './utils.js'; | ||
import { randomIntBetween } from './utils.js'; | ||
import { randomItem } from './utils.js'; | ||
import { randomString } from './utils.js'; | ||
import { uuidv4 } from './utils.js'; | ||
export { check, parseDuration, getCurrentStageIndex, tagWithCurrentStageIndex, tagWithCurrentStageProfile, findBetween, normalDistributionStages, randomIntBetween, randomItem, randomString, uuidv4 }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export function parseDuration(str: any): number; | ||
export function getCurrentStageIndex(): number; | ||
export function tagWithCurrentStageIndex(): void; | ||
export function tagWithCurrentStageProfile(): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Produces a Universal Unique Identifier version 4 | ||
* | ||
* @param {boolean} secure - whether a cryptographically secure generation function should be used | ||
* @returns {String} - 16 characters hexadecimal representation of the UUID v4 | ||
*/ | ||
export function uuidv4(secure?: boolean): string; | ||
export function randomIntBetween(min: any, max: any): number; | ||
export function randomItem(arrayOfItems: any): any; | ||
export function randomString(length: any, charset?: string): string; | ||
export function findBetween(content: any, left: any, right: any, repeat?: boolean): any; | ||
export function normalDistributionStages(maxVus: any, durationSeconds: any, numberOfStages?: number): { | ||
duration: string; | ||
target: number; | ||
}[]; |
Oops, something went wrong.