Uname: Linux webm016.cluster127.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 7.4.33 [ PHP INFO ] PHP os: Linux
Server Ip: 54.36.31.145
Your Ip: 216.73.216.182
User: homesquasz (91404) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : determineConfig.js
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _fs = _interopRequireDefault(require("fs"));

var _path = _interopRequireDefault(require("path"));

var _readPkgUp = _interopRequireDefault(require("read-pkg-up"));

var _ValidationError = _interopRequireDefault(require("../app/errors/ValidationError"));

var _logger = _interopRequireDefault(require("../logger"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const readConfigFile = configFilePath => {
  try {
    return _fs.default.readFileSync(configFilePath, 'utf8');
  } catch (error) {
    _logger.default.error(`Exception while trying to read JSON config file`, error);

    return null;
  }
};

const getConfigFileJson = configFilePath => {
  const configFileContents = readConfigFile(configFilePath);

  if (!configFileContents) {
    throw new _ValidationError.default(`Could not find JSON config file: ${configFilePath}}`);
  }

  try {
    return JSON.parse(configFileContents);
  } catch (error) {
    _logger.default.error(`Exception while parsing JSON config`, error);

    throw new _ValidationError.default(`Could not parse JSON config file: ${configFilePath}`);
  }
};

const getConfigFileJS = configFilePath => {
  const projectDir = _path.default.resolve(_fs.default.realpathSync(process.cwd()));

  const fullPath = `${projectDir}/${configFilePath}`;

  try {
    return require(fullPath); // eslint-disable-line global-require
  } catch (error) {
    _logger.default.error(`Exception while loading JS config`, error);

    throw new _ValidationError.default(`Exception while loading JS config: ${fullPath}`);
  }
};

const getConfigFileContents = configFilePath => {
  if (configFilePath.endsWith('.js')) {
    return getConfigFileJS(configFilePath);
  }

  return getConfigFileJson(configFilePath);
};

const determineConfig = cliOptions => {
  const pkgJson = (_readPkgUp.default.sync() || {}).packageJson;
  let pkgJsonbundlewatch = pkgJson.bundlewatch;

  if (cliOptions.args && cliOptions.args.length > 0) {
    if (pkgJsonbundlewatch) {
      _logger.default.warn(`CLI files supplied, config in package.json will be ignored`);
    }

    if (cliOptions.configFilePath) {
      _logger.default.warn(`CLI files supplied, configFilePath will be ignored (this must be used on its own)`);
    }

    const files = cliOptions.args.map(filePathGlob => {
      return {
        path: filePathGlob,
        maxSize: cliOptions.maxSize
      };
    });
    return {
      files,
      defaultCompression: cliOptions.compression || 'gzip',
      normalizeFilenames: cliOptions.normalize
    };
  }

  if (cliOptions.config) {
    if (pkgJsonbundlewatch) {
      _logger.default.warn(`configFilePath supplied, config in package.json will be ignored`);
    }

    return getConfigFileContents(cliOptions.config);
  }

  if (pkgJsonbundlewatch) {
    if (Array.isArray(pkgJsonbundlewatch)) {
      return {
        files: pkgJsonbundlewatch
      };
    }

    return pkgJsonbundlewatch;
  }

  return {};
};

var _default = determineConfig;
exports.default = _default;
© 2026 GrazzMean
Page non trouvée – APK Comptoir Hammami
Jannah Theme License is not validated, Go to the theme options page to validate the license, You need a single license for each domain name.

404 :(

Oups ! Cette page est introuvable.

Il semble que nous ne puissions pas trouver ce que vous cherchez. Peut-être qu'une recherche pourrait vous aider.

Bouton retour en haut de la page