helpers.ts — vue Source File
Architecture documentation for helpers.ts, a typescript file in the vue codebase. 4 imports, 2 dependents.
Entity Profile
Dependency Diagram
graph LR 84ab3997_ca97_807e_f586_e8d0a26ded10["helpers.ts"] 452898a7_6631_766c_1752_d0d7f2ce2517["filter-parser.ts"] 84ab3997_ca97_807e_f586_e8d0a26ded10 --> 452898a7_6631_766c_1752_d0d7f2ce2517 b4977dfa_c8a9_400f_00e1_dac785ffde86["parseFilters"] 84ab3997_ca97_807e_f586_e8d0a26ded10 --> b4977dfa_c8a9_400f_00e1_dac785ffde86 09aa5370_2caa_6b33_3f44_6ac5211bd11b["util"] 84ab3997_ca97_807e_f586_e8d0a26ded10 --> 09aa5370_2caa_6b33_3f44_6ac5211bd11b a80b8e3b_d720_9146_3bf6_594d4ee5dd77["compiler"] 84ab3997_ca97_807e_f586_e8d0a26ded10 --> a80b8e3b_d720_9146_3bf6_594d4ee5dd77 6a18399e_553e_fef8_6a39_746f79f94bd2["index.ts"] 6a18399e_553e_fef8_6a39_746f79f94bd2 --> 84ab3997_ca97_807e_f586_e8d0a26ded10 101d3d34_ac07_228f_62b9_5d5ac4a0ea2e["index.ts"] 101d3d34_ac07_228f_62b9_5d5ac4a0ea2e --> 84ab3997_ca97_807e_f586_e8d0a26ded10 style 84ab3997_ca97_807e_f586_e8d0a26ded10 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
Functions
Types
Dependencies
- compiler
- filter-parser.ts
- parseFilters
- util
Source
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 VueCore domain, GlobalAPI 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: VueCore, subdomain: GlobalAPI, directory: src/compiler).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free