UNPKG

chimp

Version:

Your development companion for doing quality, faster.

12 lines (11 loc) 794 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.assertModulePathInTopLevelSrc = void 0; const tslib_1 = require("tslib"); const node_path_1 = tslib_1.__importDefault(require("node:path")); function assertModulePathInTopLevelSrc(projectMainPath, modulePath) { if (node_path_1.default.join(projectMainPath, modulePath).indexOf(node_path_1.default.join(projectMainPath, './src')) !== 0) { throw new Error('Sorry! Chimp currently only works if your source code lives under ./src folder. We are happy to take a PR that changes that if you absolutely need so, but we think src is such a common pattern it makes little sense to make the code more complex "just in case"'); } } exports.assertModulePathInTopLevelSrc = assertModulePathInTopLevelSrc;