import type { IWorker, MeasurementStatistics } from './worker'
export const checkFilePath = (filePath: string): void => {
- if (
- filePath == null ||
- typeof filePath !== 'string' ||
- (typeof filePath === 'string' && filePath.trim().length === 0)
- ) {
- throw new Error('Please specify a file with a worker implementation')
- }
if (!existsSync(filePath)) {
throw new Error(`Cannot find the worker file '${filePath}'`)
}