Lines 2950-2990javascript
2951 * This file is used to define any aliases for imports in the client code. This is useful for mocking modules during testing or for providing alternative implementations of certain modules.
2952 * For example, if we want to mock the "pinets" module during testing, we can add an entry to the IMPORT_ALIAS object that points to our mock implementation. Then, when the client code tries to import "pinets", it will receive our mock implementation instead of the actual "pinets" module.
2953 * This allows us to isolate the client code from external dependencies and test it more effectively.
2954 * Note that the keys in the IMPORT_ALIAS object should match the module names used in the client code, and the values should be the corresponding mock implementations or alternative modules.
2956 * // To mock the "pinets" module, we can add the following entry to the IMPORT_ALIAS object:
2957 * Object.assign(IMPORT_ALIAS, {
2958 * "pinets": require("pinets/dist/pinets.min.browser.js"),
2961const IMPORT_ALIAS = {};
2963const USE_ESMODULE_DEFAULT = false;
2964const IMPORT_PATHS_EXCLUDE = new Set(["dump", "logs", "modules", "config", "node_modules"]);
2965const TRANSPILE_FN = functoolsKit.memoize(([path]) => `${path}`, (path, code, self, require) => {
2966 const __filename = self.__filename;
2967 const __dirname = self.__dirname;
2968 const module = { exports: {} };
2969 const exports = module.exports;
2971 eval(self.params.babel.transpile(code, path));
2972 }
LowEval
Package source references a known benign dynamic code generation pattern.
build/index.cjsView on unpkg · L2970 2974 console.log(`Error during transpilation error=\`${functoolsKit.getErrorMessage(error)}\` path=\`${path}\` __filename=\`${__filename}\` __dirname=\`${__dirname}\``);
2986const REQUIRE_ENTRY_FACTORY = (filePath, self, seen, errors) => {
2987 const baseRequire = CREATE_BASE_REQUIRE_FN(self, seen);
2989 return { exports: baseRequire(filePath) };