Home / File/ pluginFilter.spec.ts — vite Source File

pluginFilter.spec.ts — vite Source File

Architecture documentation for pluginFilter.spec.ts, a typescript file in the vite codebase. 8 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  b0896fc6_000a_3898_27ef_397aecd8e155["pluginFilter.spec.ts"]
  ed570918_8c20_047e_d700_db6178114e8f["pluginFilter.ts"]
  b0896fc6_000a_3898_27ef_397aecd8e155 --> ed570918_8c20_047e_d700_db6178114e8f
  3d7ff47b_081c_c60e_224a_66b680cb7e2b["createCodeFilter"]
  b0896fc6_000a_3898_27ef_397aecd8e155 --> 3d7ff47b_081c_c60e_224a_66b680cb7e2b
  d7f67fe9_b7c9_af12_925b_3c23f7ce8c79["createFilterForTransform"]
  b0896fc6_000a_3898_27ef_397aecd8e155 --> d7f67fe9_b7c9_af12_925b_3c23f7ce8c79
  4cdadc30_895b_3584_a0e8_801554f99fbe["createIdFilter"]
  b0896fc6_000a_3898_27ef_397aecd8e155 --> 4cdadc30_895b_3584_a0e8_801554f99fbe
  10809968_066c_58db_f8b4_cb0464da805e["node:util"]
  b0896fc6_000a_3898_27ef_397aecd8e155 --> 10809968_066c_58db_f8b4_cb0464da805e
  51e96894_3556_ed5c_1ede_97d449867adf["node:path"]
  b0896fc6_000a_3898_27ef_397aecd8e155 --> 51e96894_3556_ed5c_1ede_97d449867adf
  a340ba46_b2b7_3048_3bb3_6907a74c8464["vitest"]
  b0896fc6_000a_3898_27ef_397aecd8e155 --> a340ba46_b2b7_3048_3bb3_6907a74c8464
  693ca867_249b_3e5a_0ce1_8930413b7fcd["rolldown"]
  b0896fc6_000a_3898_27ef_397aecd8e155 --> 693ca867_249b_3e5a_0ce1_8930413b7fcd
  style b0896fc6_000a_3898_27ef_397aecd8e155 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import util from 'node:util'
import path from 'node:path'
import { describe, expect, test } from 'vitest'
import type { ModuleTypeFilter } from 'rolldown'
import {
  type StringFilter,
  createCodeFilter,
  createFilterForTransform,
  createIdFilter,
} from '../../plugins/pluginFilter'

describe('createIdFilter', () => {
  const filters = [
    { inputFilter: undefined, cases: undefined },
    {
      inputFilter: 'foo.js',
      cases: [
        { id: 'foo.js', expected: true },
        { id: 'foo.ts', expected: false },
        { id: '\0foo.js', expected: false },
        { id: '\0' + path.resolve('foo.js'), expected: false },
      ],
    },
    {
      inputFilter: ['foo.js'],
      cases: [
        { id: 'foo.js', expected: true },
        { id: 'foo.ts', expected: false },
      ],
    },
    {
      inputFilter: { include: 'foo.js' },
      cases: [
        { id: 'foo.js', expected: true },
        { id: 'foo.ts', expected: false },
      ],
    },
    {
      inputFilter: { include: '*.js' },
      cases: [
        { id: 'foo.js', expected: true },
        { id: 'foo.ts', expected: false },
      ],
    },
    {
      inputFilter: { include: /\.js$/ },
      cases: [
        { id: 'foo.js', expected: true },
        { id: 'foo.ts', expected: false },
      ],
    },
    {
      inputFilter: { include: /\/foo\.js$/ },
      cases: [
        { id: 'a/foo.js', expected: true },
        ...(process.platform === 'win32'
          ? [{ id: 'a\\foo.js', expected: true }]
          : []),
        { id: 'a_foo.js', expected: false },
      ],
// ... (284 more lines)

Domain

Types

Dependencies

Frequently Asked Questions

What does pluginFilter.spec.ts do?
pluginFilter.spec.ts is a source file in the vite codebase, written in typescript. It belongs to the ViteCore domain.
What does pluginFilter.spec.ts depend on?
pluginFilter.spec.ts imports 8 module(s): createCodeFilter, createFilterForTransform, createIdFilter, node:path, node:util, pluginFilter.ts, rolldown, vitest.
Where is pluginFilter.spec.ts in the architecture?
pluginFilter.spec.ts is located at packages/vite/src/node/__tests__/plugins/pluginFilter.spec.ts (domain: ViteCore, directory: packages/vite/src/node/__tests__/plugins).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free