Home / File/ helpers.ts — vue Source File

helpers.ts — vue Source File

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

File typescript CompilerSFC ScriptAnalyzer 4 imports 2 dependents 13 functions

Entity Profile

Dependency Diagram

graph LR
  59b7cd33_3172_bd71_66da_0b9508449054["helpers.ts"]
  9fe9aa1f_3948_0a47_c873_c987dae2f0ed["filter-parser.ts"]
  59b7cd33_3172_bd71_66da_0b9508449054 --> 9fe9aa1f_3948_0a47_c873_c987dae2f0ed
  b1101a58_6379_8514_36a1_9d7f75b2b23f["parseFilters"]
  59b7cd33_3172_bd71_66da_0b9508449054 --> b1101a58_6379_8514_36a1_9d7f75b2b23f
  156bf2e1_8a13_f22d_5437_54f14bcef8fa["util"]
  59b7cd33_3172_bd71_66da_0b9508449054 --> 156bf2e1_8a13_f22d_5437_54f14bcef8fa
  47ae9f26_59d1_fab2_349f_966f5d15495a["compiler"]
  59b7cd33_3172_bd71_66da_0b9508449054 --> 47ae9f26_59d1_fab2_349f_966f5d15495a
  54260741_ae9d_a025_86de_47c513f5f82d["index.ts"]
  54260741_ae9d_a025_86de_47c513f5f82d --> 59b7cd33_3172_bd71_66da_0b9508449054
  320ee0f4_351d_a6b2_1c1c_f0f6f42fb987["index.ts"]
  320ee0f4_351d_a6b2_1c1c_f0f6f42fb987 --> 59b7cd33_3172_bd71_66da_0b9508449054
  style 59b7cd33_3172_bd71_66da_0b9508449054 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { emptyObject } from 'shared/util'
import { ASTElement, ASTModifiers } from 'types/compiler'
import { parseFilters } from './parser/filter-parser'

type Range = { start?: number; end?: number }

/* eslint-disable no-unused-vars */
export function baseWarn(msg: string, range?: Range) {
  console.error(`[Vue compiler]: ${msg}`)
}
/* eslint-enable no-unused-vars */

export function pluckModuleFunction<T, K extends keyof T>(
  modules: Array<T> | undefined,
  key: K
): Array<Exclude<T[K], undefined>> {
  return modules ? (modules.map(m => m[key]).filter(_ => _) as any) : []
}

export function addProp(
  el: ASTElement,
  name: string,
  value: string,
  range?: Range,
  dynamic?: boolean
) {
  ;(el.props || (el.props = [])).push(
    rangeSetItem({ name, value, dynamic }, range)
  )
  el.plain = false
}

export function addAttr(
  el: ASTElement,
  name: string,
  value: any,
  range?: Range,
  dynamic?: boolean
) {
  const attrs = dynamic
    ? el.dynamicAttrs || (el.dynamicAttrs = [])
    : el.attrs || (el.attrs = [])
  attrs.push(rangeSetItem({ name, value, dynamic }, range))
  el.plain = false
}

// add a raw attr (use this in preTransforms)
export function addRawAttr(
  el: ASTElement,
  name: string,
  value: any,
  range?: Range
) {
  el.attrsMap[name] = value
  el.attrsList.push(rangeSetItem({ name, value }, range))
}

export function addDirective(
  el: ASTElement,
  name: string,
// ... (184 more lines)

Domain

Subdomains

Types

Dependencies

Frequently Asked Questions

What does helpers.ts do?
helpers.ts is a source file in the vue codebase, written in typescript. It belongs to the CompilerSFC domain, ScriptAnalyzer subdomain.
What functions are defined in helpers.ts?
helpers.ts defines 13 function(s): addAttr, addDirective, addHandler, addProp, addRawAttr, baseWarn, getAndRemoveAttr, getAndRemoveAttrByRegex, getBindingAttr, getRawBindingAttr, and 3 more.
What does helpers.ts depend on?
helpers.ts imports 4 module(s): compiler, filter-parser.ts, parseFilters, util.
What files import helpers.ts?
helpers.ts is imported by 2 file(s): index.ts, index.ts.
Where is helpers.ts in the architecture?
helpers.ts is located at src/compiler/helpers.ts (domain: CompilerSFC, subdomain: ScriptAnalyzer, directory: src/compiler).

Analyze Your Own Codebase

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

Try Supermodel Free