{"version":3,"file":"_assertions.mjs","names":[],"sources":["../../../src/server/commands/_assertions.ts"],"sourcesContent":["import { isAbsolute } from 'pathe'\nimport type { RequiredPick } from 'type-plus'\nimport type { ExtendedBrowserCommandContext } from '../vis_server_context.types.ts'\n\nexport function assertTestPathDefined(\n\tcontext: ExtendedBrowserCommandContext,\n\tcommandName: string,\n): asserts context is RequiredPick<ExtendedBrowserCommandContext, 'testPath'> {\n\tif (!context.testPath) {\n\t\tthrow new Error(`'commands.${commandName}' requires testPath to be defined`)\n\t}\n}\n\nexport function assertIsRelativePath(relativeFilePath: string, propName: string) {\n\tif (isAbsolute(relativeFilePath)) {\n\t\tthrow new Error(`'${propName}' must be a relative path`)\n\t}\n}\n"],"mappings":";;;AAIA,SAAgB,sBACf,SACA,aAC6E;AAC7E,KAAI,CAAC,QAAQ,SACZ,OAAM,IAAI,MAAM,aAAa,YAAY,mCAAmC"}