\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82 csarite.com
KUJUNTI.ID MINISH3LL
Path : /var/www/html/infraai.ai/frontend/node_modules/ts-node/dist-raw/
(S)h3ll Cr3at0r :
F!le Upl0ad :

B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H

Current File : /var/www/html/infraai.ai/frontend/node_modules/ts-node/dist-raw/node-internalBinding-fs.js


const fs = require('fs');
const {versionGteLt} = require('../dist/util');

// In node's core, this is implemented in C
// https://github.com/nodejs/node/blob/v15.3.0/src/node_file.cc#L891-L985
/**
 * @param {string} path
 * @returns {[] | [string, boolean]}
 */
function internalModuleReadJSON(path) {
  let string
  try {
    string = fs.readFileSync(path, 'utf8')
  } catch (e) {
    if (e.code === 'ENOENT') return []
    throw e
  }
  // Node's implementation checks for the presence of relevant keys: main, name, type, exports, imports
  // Node does this for performance to skip unnecessary parsing.
  // This would slow us down and, based on our usage, we can skip it.
  const containsKeys = true
  return [string, containsKeys]
}

// In node's core, this is implemented in C
// https://github.com/nodejs/node/blob/63e7dc1e5c71b70c80ed9eda230991edb00811e2/src/node_file.cc#L987-L1005
/**
 * @param {string} path
 * @returns {number} 0 = file, 1 = dir, negative = error
 */
function internalModuleStat(path) {
  const stat = fs.statSync(path, { throwIfNoEntry: false });
  if(!stat) return -1;
  if(stat.isFile()) return 0;
  if(stat.isDirectory()) return 1;
}

/**
 * @param {string} path
 * @returns {number} 0 = file, 1 = dir, negative = error
 */
function internalModuleStatInefficient(path) {
  try {
    const stat = fs.statSync(path);
    if(stat.isFile()) return 0;
    if(stat.isDirectory()) return 1;
  } catch(e) {
    return -e.errno || -1;
  }
}

const statSupportsThrowIfNoEntry = versionGteLt(process.versions.node, '15.3.0') ||
  versionGteLt(process.versions.node, '14.17.0', '15.0.0');

module.exports = {
  internalModuleReadJSON,
  internalModuleStat: statSupportsThrowIfNoEntry ? internalModuleStat : internalModuleStatInefficient
};

© KUJUNTI.ID