(file: string, record: RecordInfo)
| 273 | |
| 274 | // target file to inject code |
| 275 | async function isTargetFileToInject(file: string, record: RecordInfo) { |
| 276 | const inputs: string[] = await (record.inputs || []); |
| 277 | const recordInfo = getProjectRecord(record); |
| 278 | const normalizedFile = normalizePath(file); |
| 279 | return ( |
| 280 | (isJsTypeFile(file) && getFilePathWithoutExt(file) === recordInfo?.entry) || |
| 281 | isAstroToolbarFile(file) || |
| 282 | (recordInfo?.injectTo || []).includes(normalizedFile) || |
| 283 | inputs.includes(normalizedFile) |
| 284 | ); |
| 285 | } |
| 286 | |
| 287 | function recordInjectTo(record: RecordInfo, options: CodeOptions) { |
| 288 | if (options?.injectTo) { |
no test coverage detected