-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: export types * chore: gen yarn.lock * chore: tweaks docs * refactor: rename types * chore: add docs
- Loading branch information
1 parent
77f91e4
commit c5e7edb
Showing
15 changed files
with
99 additions
and
62 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
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
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
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 |
---|---|---|
@@ -1,4 +1,13 @@ | ||
export { compare } from './compare'; | ||
export { formatMetadata } from './utils/format'; | ||
|
||
export type { PerformanceHeader, PerformanceMetadata, PerformanceEntry } from './types'; | ||
export type { | ||
MeasureHeader, | ||
MeasureMetadata, | ||
MeasureEntry, | ||
CompareResult, | ||
CompareMetadata, | ||
CompareEntry, | ||
AddedEntry, | ||
RemovedEntry, | ||
} from './types'; |
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
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
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
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
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
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import { z } from 'zod'; | ||
import { performanceHeaderSchema, performanceEntrySchema } from '../type-schemas'; | ||
import type { PerformanceEntry, PerformanceHeader } from '../types'; | ||
import { MeasureHeaderScheme, MeasureEntryScheme } from '../type-schemas'; | ||
import type { MeasureEntry, MeasureHeader } from '../types'; | ||
import { hasDuplicateValues } from './array'; | ||
|
||
const performanceEntriesSchema = z | ||
.array(performanceEntrySchema) | ||
const MeasureEntryArraySchema = z | ||
.array(MeasureEntryScheme) | ||
.refine((val) => !hasDuplicateValues(val.map((val) => val.name)), { | ||
message: `Your performance result file contains records with duplicated names. | ||
Please remove any non-unique names from your test suites and try again.`, | ||
}); | ||
|
||
export function parseHeader(header: unknown): PerformanceHeader | null { | ||
return performanceHeaderSchema.parse(header); | ||
export function parseHeader(header: unknown): MeasureHeader | null { | ||
return MeasureHeaderScheme.parse(header); | ||
} | ||
|
||
export function parsePerformanceEntries(entries: unknown): PerformanceEntry[] { | ||
return performanceEntriesSchema.parse(entries); | ||
export function parseMeasureEntries(entries: unknown): MeasureEntry[] { | ||
return MeasureEntryArraySchema.parse(entries); | ||
} |
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
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
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
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
Oops, something went wrong.