chore: fix typo Stringiable -> Stringifiable (#1200)
This commit is contained in:
parent
e985c5c826
commit
b2dd5612ff
@ -33,10 +33,10 @@ export const enum StringifyThresholds {
|
|||||||
NODE_COUNT = 20
|
NODE_COUNT = 20
|
||||||
}
|
}
|
||||||
|
|
||||||
type StringiableNode = PlainElementNode | TextCallNode
|
type StringifiableNode = PlainElementNode | TextCallNode
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Turn eligible hoisted static trees into stringied static nodes, e.g.
|
* Turn eligible hoisted static trees into stringified static nodes, e.g.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* const _hoisted_1 = createStaticVNode(`<div class="foo">bar</div>`)
|
* const _hoisted_1 = createStaticVNode(`<div class="foo">bar</div>`)
|
||||||
@ -61,7 +61,7 @@ type StringiableNode = PlainElementNode | TextCallNode
|
|||||||
export const stringifyStatic: HoistTransform = (children, context) => {
|
export const stringifyStatic: HoistTransform = (children, context) => {
|
||||||
let nc = 0 // current node count
|
let nc = 0 // current node count
|
||||||
let ec = 0 // current element with binding count
|
let ec = 0 // current element with binding count
|
||||||
const currentChunk: StringiableNode[] = []
|
const currentChunk: StringifiableNode[] = []
|
||||||
|
|
||||||
const stringifyCurrentChunk = (currentIndex: number): number => {
|
const stringifyCurrentChunk = (currentIndex: number): number => {
|
||||||
if (
|
if (
|
||||||
@ -101,7 +101,7 @@ export const stringifyStatic: HoistTransform = (children, context) => {
|
|||||||
const hoisted = getHoistedNode(child)
|
const hoisted = getHoistedNode(child)
|
||||||
if (hoisted) {
|
if (hoisted) {
|
||||||
// presence of hoisted means child must be a stringifiable node
|
// presence of hoisted means child must be a stringifiable node
|
||||||
const node = child as StringiableNode
|
const node = child as StringifiableNode
|
||||||
const result = analyzeNode(node)
|
const result = analyzeNode(node)
|
||||||
if (result) {
|
if (result) {
|
||||||
// node is stringifiable, record state
|
// node is stringifiable, record state
|
||||||
@ -137,7 +137,7 @@ const isStringifiableAttr = (name: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const replaceHoist = (
|
const replaceHoist = (
|
||||||
node: StringiableNode,
|
node: StringifiableNode,
|
||||||
replacement: JSChildNode | null,
|
replacement: JSChildNode | null,
|
||||||
context: TransformContext
|
context: TransformContext
|
||||||
) => {
|
) => {
|
||||||
@ -152,7 +152,7 @@ const replaceHoist = (
|
|||||||
* - nc is the number of nodes inside
|
* - nc is the number of nodes inside
|
||||||
* - ec is the number of element with bindings inside
|
* - ec is the number of element with bindings inside
|
||||||
*/
|
*/
|
||||||
function analyzeNode(node: StringiableNode): [number, number] | false {
|
function analyzeNode(node: StringifiableNode): [number, number] | false {
|
||||||
if (node.type === NodeTypes.TEXT_CALL) {
|
if (node.type === NodeTypes.TEXT_CALL) {
|
||||||
return [1, 0]
|
return [1, 0]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user