Server : nginx/1.18.0 System : Linux localhost 6.14.3-x86_64-linode168 #1 SMP PREEMPT_DYNAMIC Mon Apr 21 19:47:55 EDT 2025 x86_64 User : www-data ( 33) PHP Version : 8.0.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/ecommerce/node_modules/adjust-sourcemap-loader/lib/process/ |
'use strict';
const PACKAGE_NAME = require('../../package.json').name,
PADDING = (new Array(11)).join(' ');
/**
* Format a debug message
* @param {{resourcePath:string, loaders:Array, loaderIndex:number}} context A loader or compilation
* @param {{input:Array.<string>, absolute:Array.<string>, output:Array.<string>, root:string}} info Source-map info
* @returns {string} An encoded debug string
*/
function debugMessage(context, info) {
return [
' ',
PACKAGE_NAME + ':',
' ' + context.resourcePath,
formatField('@', precedingRequest(context)),
formatField('INPUT', info.input || '(source-map absent)'),
formatField('ABSOLUTE', info.absolute),
formatField('OUTPUT', info.output),
formatField('ROOT', info.root)
]
.filter(Boolean)
.join('\n');
}
module.exports = debugMessage;
/**
* Find the request that precedes this loader in the loader chain
* @param {{loaders:Array, loaderIndex:number}} loader The loader context
* @returns {string} The request of the preceding loader
*/
function precedingRequest(loader) {
var isLoader = ('loaderIndex' in loader) && ('loaders' in loader) && Array.isArray(loader.loaders);
if (isLoader) {
var index = loader.loaderIndex + 1;
return (index in loader.loaders) ? loader.loaders[index].request : '(no preceding loader)';
}
}
/**
* Where the data is truthy then format it with a right-aligned title.
* @param {string} title
* @param {*} data The data to display
* @returns {boolean|string} False where data is falsey, else formatted message
*/
function formatField(title, data) {
return !!data && (rightAlign(title) + formatData(data));
function rightAlign(text) {
return (PADDING + text + ' ').slice(-PADDING.length);
}
function formatData(data) {
return Array.isArray(data) ? data.join('\n' + PADDING) : data;
}
}