util.ts — vue Source File
Architecture documentation for util.ts, a typescript file in the vue codebase. 0 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR b7977953_caa1_d867_207c_74cfbf6421e0["util.ts"] 3a7c7919_1905_22a7_f604_9084d5e5d0df["apiSetup.ts"] 3a7c7919_1905_22a7_f604_9084d5e5d0df --> b7977953_caa1_d867_207c_74cfbf6421e0 style b7977953_caa1_d867_207c_74cfbf6421e0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
export const emptyObject: Record<string, any> = Object.freeze({})
export const isArray = Array.isArray
// These helpers produce better VM code in JS engines due to their
// explicitness and function inlining.
export function isUndef(v: any): v is undefined | null {
return v === undefined || v === null
}
export function isDef<T>(v: T): v is NonNullable<T> {
return v !== undefined && v !== null
}
export function isTrue(v: any): boolean {
return v === true
}
export function isFalse(v: any): boolean {
return v === false
}
/**
* Check if value is primitive.
*/
export function isPrimitive(value: any): boolean {
return (
typeof value === 'string' ||
typeof value === 'number' ||
// $flow-disable-line
typeof value === 'symbol' ||
typeof value === 'boolean'
)
}
export function isFunction(value: any): value is (...args: any[]) => any {
return typeof value === 'function'
}
/**
* Quick object check - this is primarily used to tell
* objects from primitive values when we know the value
* is a JSON-compliant type.
*/
export function isObject(obj: any): boolean {
return obj !== null && typeof obj === 'object'
}
/**
* Get the raw type string of a value, e.g., [object Object].
*/
const _toString = Object.prototype.toString
export function toRawType(value: any): string {
return _toString.call(value).slice(8, -1)
}
/**
* Strict object type check. Only returns true
* for plain JavaScript objects.
// ... (319 more lines)
Domain
Subdomains
Functions
- cached()
- camelize()
- capitalize()
- extend()
- genStaticKeys()
- hasChanged()
- hasOwn()
- hyphenate()
- identity()
- isDef()
- isFalse()
- isFunction()
- isObject()
- isPlainObject()
- isPrimitive()
- isPromise()
- isRegExp()
- isTrue()
- isUndef()
- isValidArrayIndex()
- looseEqual()
- looseIndexOf()
- makeMap()
- nativeBind()
- no()
- noop()
- once()
- polyfillBind()
- remove()
- replacer()
- toArray()
- toNumber()
- toObject()
- toRawType()
- toString()
Imported By
Source
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, GlobalAPI subdomain.
What functions are defined in util.ts?
util.ts defines 35 function(s): cached, camelize, capitalize, extend, genStaticKeys, hasChanged, hasOwn, hyphenate, identity, isDef, and 25 more.
What files import util.ts?
util.ts is imported by 1 file(s): apiSetup.ts.
Where is util.ts in the architecture?
util.ts is located at src/shared/util.ts (domain: VueCore, subdomain: GlobalAPI, directory: src/shared).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free