MCPcopy
hub / github.com/promptfoo/promptfoo / isJavascriptFile

Function isJavascriptFile

src/util/fileExtensions.ts:12–14  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

10 * @returns True if the file has a JavaScript or TypeScript extension, false otherwise.
11 */
12export function isJavascriptFile(filePath: string): boolean {
13 return new RegExp(`\\.(${JAVASCRIPT_EXTENSIONS.join('|')})$`).test(filePath);
14}
15
16/**
17 * Checks if a file is an image file based on its extension. Non-exhaustive list.

Callers 15

file.test.tsFile · 0.90
renderPromptFunction · 0.90
assertionFromStringFunction · 0.90
index.tsFile · 0.90
runAssertionFunction · 0.90
registry.tsFile · 0.90
redteam.tsFile · 0.90
handleSubmitFunction · 0.90
validatePathFunction · 0.90
loadStrategyFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…