| Server IP : 139.59.63.204 / Your IP : 216.73.217.62 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ubuntu-s-1vcpu-1gb-blr1-01 6.8.0-110-generic #110-Ubuntu SMP PREEMPT_DYNAMIC Thu Mar 19 15:09:20 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/abyogasms.com/node_modules/enhanced-resolve/lib/ |
Upload File : |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("./Resolver").ResolveContext} ResolveContext */
/**
* Build the `ResolveContext` passed into the next hook in the chain.
*
* The caller — `Resolver.doResolve` — runs on every resolve step, so we
* want to allocate as little as possible here. Previously the caller
* constructed a temporary `{ log, yield, fileDependencies, ... }` literal
* and handed it to this helper, which then copied those same fields into
* a second fresh object. That's two allocations per step for what is
* effectively a struct copy with one mutated field (`stack`) and one
* optionally-wrapped field (`log`). Taking the parent context and the
* two things we actually want to change (stack, message) as separate
* arguments lets us allocate exactly one inner context.
* @param {ResolveContext} parent parent resolve context to inherit dependency sets / yield from
* @param {ResolveContext["stack"]} stack new stack tip for the nested call
* @param {null | string} message log message prefix for this step
* @returns {ResolveContext} inner context
*/
module.exports = function createInnerContext(parent, stack, message) {
const parentLog = parent.log;
let innerLog;
if (parentLog) {
if (message) {
let messageReported = false;
/**
* @param {string} msg message
*/
innerLog = (msg) => {
if (!messageReported) {
parentLog(message);
messageReported = true;
}
parentLog(` ${msg}`);
};
} else {
innerLog = parentLog;
}
}
return {
log: innerLog,
yield: parent.yield,
fileDependencies: parent.fileDependencies,
contextDependencies: parent.contextDependencies,
missingDependencies: parent.missingDependencies,
stack,
};
};