type OptionalOptions = 'isNativeTag' | 'isBuiltInComponent'
type MergedParserOptions = Omit<Required<ParserOptions>, OptionalOptions> &
Pick<ParserOptions, OptionalOptions>
+type AttributeValue =
+ | {
+ content: string
+ isQuoted: boolean
+ loc: SourceLocation
+ }
+ | undefined
// The default decoder only provides escapes for characters reserved as part of
// the template syntax, and is only used if the custom renderer did not provide
advanceBy(context, name.length)
// Value
- let value:
- | {
- content: string
- isQuoted: boolean
- loc: SourceLocation
- }
- | undefined = undefined
+ let value: AttributeValue = undefined
if (/^[\t\r\n\f ]*=/.test(context.source)) {
advanceSpaces(context)
}
}
-function parseAttributeValue(
- context: ParserContext
-):
- | {
- content: string
- isQuoted: boolean
- loc: SourceLocation
- }
- | undefined {
+function parseAttributeValue(context: ParserContext): AttributeValue {
const start = getCursor(context)
let content: string