Skip to content

Commit

Permalink
test checks using the build output
Browse files Browse the repository at this point in the history
  • Loading branch information
allansson committed Jul 24, 2024
1 parent bdd0f19 commit 099c612
Show file tree
Hide file tree
Showing 11 changed files with 279 additions and 7 deletions.
12 changes: 12 additions & 0 deletions build/check.d.ts
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 {};
12 changes: 12 additions & 0 deletions build/index.d.ts
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 };
2 changes: 1 addition & 1 deletion build/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/index.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions build/stages.d.ts
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;
15 changes: 15 additions & 0 deletions build/utils.d.ts
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;
}[];
Loading

0 comments on commit 099c612

Please sign in to comment.