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 CompilerSFC TemplateTransformer 2 imports 2 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  240d4660_83b3_21e3_5187_23f87cd014f3["util.ts"]
  ff0056ca_ef4a_c90b_6818_0264c781fccd["index.ts"]
  240d4660_83b3_21e3_5187_23f87cd014f3 --> ff0056ca_ef4a_c90b_6818_0264c781fccd
  68fab7cc_2ec3_2365_0e38_d221542cf121["parser"]
  240d4660_83b3_21e3_5187_23f87cd014f3 --> 68fab7cc_2ec3_2365_0e38_d221542cf121
  e4b641cd_cedf_fcbc_ccab_c4e184e0c140["compileScript.spec.ts"]
  e4b641cd_cedf_fcbc_ccab_c4e184e0c140 --> 240d4660_83b3_21e3_5187_23f87cd014f3
  f4ed901c_e7f6_857a_f801_613160290ece["cssVars.spec.ts"]
  f4ed901c_e7f6_857a_f801_613160290ece --> 240d4660_83b3_21e3_5187_23f87cd014f3
  style 240d4660_83b3_21e3_5187_23f87cd014f3 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 CompilerSFC domain, TemplateTransformer 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: CompilerSFC, subdomain: TemplateTransformer, 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