es-html-parser
Advanced tools
Comparing version 1.0.0-alpha.3 to 1.0.0-alpha.4
@@ -50,2 +50,3 @@ "use strict"; | ||
accumulatedContent: new chars_buffer_1.CharsBuffer(), | ||
tokenAdapter, | ||
sourceCode: new source_code_1.SourceCode(source, templateRanges || []), | ||
@@ -52,0 +53,0 @@ tokens: { |
@@ -6,2 +6,3 @@ import { TokenizerContextTypes } from "../constants"; | ||
import { AnyToken } from "./token"; | ||
import { TokenAdapter } from "./token-adapter"; | ||
type ContextParams = { | ||
@@ -28,2 +29,3 @@ [TokenizerContextTypes.AttributeValueWrapped]?: { | ||
templateRanges: Range[]; | ||
tokenAdapter: TokenAdapter; | ||
sourceCode: SourceCode; | ||
@@ -30,0 +32,0 @@ tokens: { |
@@ -6,10 +6,13 @@ "use strict"; | ||
return state.mode === "template" && state.accumulatedContent.hasTemplate() | ||
? state.accumulatedContent.getTemplates().map((chars) => ({ | ||
type: type, | ||
range: chars.range, | ||
loc: state.sourceCode.getLocationOf(chars.range), | ||
isTemplate: chars.isTemplate, | ||
value: chars.value, | ||
})) | ||
? state.accumulatedContent.getTemplates().map((chars) => { | ||
const token = { | ||
type: type, | ||
range: chars.range, | ||
loc: state.sourceCode.getLocationOf(chars.range), | ||
isTemplate: chars.isTemplate, | ||
value: chars.value, | ||
}; | ||
return Object.assign(Object.assign({}, token), { range: state.tokenAdapter.finalizeRange(token), loc: state.tokenAdapter.finalizeLocation(token) }); | ||
}) | ||
: []; | ||
} |
{ | ||
"name": "es-html-parser", | ||
"version": "1.0.0-alpha.3", | ||
"version": "1.0.0-alpha.4", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
137202
2979