(
/** @type {string} */ pathname,
/** @type {string[]} */ allowedExtensions,
)
| 1668 | } |
| 1669 | |
| 1670 | function assertFileHasCorrectExtensions( |
| 1671 | /** @type {string} */ pathname, |
| 1672 | /** @type {string[]} */ allowedExtensions, |
| 1673 | ) { |
| 1674 | if (!allowedExtensions.includes(path.parse(pathname).ext)) { |
| 1675 | printErrorAndExit(new Error(), [ |
| 1676 | `Expected schema file "./${pathname}" to have a valid file extension`, |
| 1677 | `Valid file extensions: ${JSON.stringify(allowedExtensions, null, 2)}`, |
| 1678 | ]) |
| 1679 | } |
| 1680 | } |
| 1681 | |
| 1682 | function assertFileHasNoBom(/** @type {DataFile} */ file) { |
| 1683 | const bomTypes = [ |
no test coverage detected