@grouparoo/core
Version:
The Grouparoo Core
22 lines (21 loc) • 786 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoreVersionValidator = void 0;
const actionhero_1 = require("actionhero");
class CoreVersionValidator extends actionhero_1.Initializer {
constructor() {
super();
this.name = "coreVersionValidator";
this.startPriority = 2;
}
async initialize() {
const modulePrefixes = Object.keys(require.cache)
.filter((file) => file.includes("grouparoo/core"))
.map((file) => file.split("grouparoo/core")[0]);
const uniqPrefixes = new Set(modulePrefixes);
if (uniqPrefixes.size > 1) {
throw new Error("Found multiple versions of @grouparoo/core.");
}
}
}
exports.CoreVersionValidator = CoreVersionValidator;