Home / File/ util.ts — vue Source File

util.ts — vue Source File

Architecture documentation for util.ts, a typescript file in the vue codebase. 2 imports, 2 dependents.

File typescript VueCore VDom 2 imports 2 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  6d6bc116_08b7_aba4_746f_b6a4c1096a7f["util.ts"]
  2d0b7943_2ac1_bdbf_a8a4_e0377d6f068a["index.ts"]
  6d6bc116_08b7_aba4_746f_b6a4c1096a7f --> 2d0b7943_2ac1_bdbf_a8a4_e0377d6f068a
  349d6930_cc0f_5a60_fcc7_13e5b0d624c0["parser"]
  6d6bc116_08b7_aba4_746f_b6a4c1096a7f --> 349d6930_cc0f_5a60_fcc7_13e5b0d624c0
  e91c3191_e713_5a24_f1a5_0b0a82abbda9["compileScript.spec.ts"]
  e91c3191_e713_5a24_f1a5_0b0a82abbda9 --> 6d6bc116_08b7_aba4_746f_b6a4c1096a7f
  96b0a941_14dd_6c12_d506_e1acdf62650e["cssVars.spec.ts"]
  96b0a941_14dd_6c12_d506_e1acdf62650e --> 6d6bc116_08b7_aba4_746f_b6a4c1096a7f
  style 6d6bc116_08b7_aba4_746f_b6a4c1096a7f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {
  parse,
  compileScript,
  type SFCParseOptions,
  type SFCScriptCompileOptions
} from '../src'
import { parse as babelParse } from '@babel/parser'

export const mockId = 'xxxxxxxx'

export function compile(
  source: string,
  options?: Partial<SFCScriptCompileOptions>,
  parseOptions?: Partial<SFCParseOptions>
) {
  const sfc = parse({
    ...parseOptions,
    source
  })
  return compileScript(sfc, { id: mockId, ...options })
}

export function assertCode(code: string) {
  // parse the generated code to make sure it is valid
  try {
    babelParse(code, {
      sourceType: 'module',
      plugins: ['typescript']
    })
  } catch (e: any) {
    console.log(code)
    throw e
  }
  expect(code).toMatchSnapshot()
}

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does util.ts do?
util.ts is a source file in the vue codebase, written in typescript. It belongs to the VueCore domain, VDom subdomain.
What functions are defined in util.ts?
util.ts defines 2 function(s): assertCode, compile.
What does util.ts depend on?
util.ts imports 2 module(s): index.ts, parser.
What files import util.ts?
util.ts is imported by 2 file(s): compileScript.spec.ts, cssVars.spec.ts.
Where is util.ts in the architecture?
util.ts is located at packages/compiler-sfc/test/util.ts (domain: VueCore, subdomain: VDom, directory: packages/compiler-sfc/test).

Analyze Your Own Codebase

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

Try Supermodel Free