File tree Expand file tree Collapse file tree 6 files changed +16
-13
lines changed Expand file tree Collapse file tree 6 files changed +16
-13
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @hyperse/html-webpack-plugin-loader " : patch
3
+ ---
4
+
5
+ fix typo issue
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ const modifiedHtml = parser
154
154
- ` upsertHeadStyles(styles: StyleItem[]) ` : Updates or inserts external style links in the head
155
155
- ` upsertHeadInlineStyles(styles: StyleInlineItem[]) ` : Updates or inserts inline style tags in the head
156
156
- ` upsertHeadScripts(scripts: ScriptItem[]) ` : Updates or inserts external script tags in the head
157
- - ` upsertHeadInlineScripts(scripts: ScriptionInlineItem []) ` : Updates or inserts inline script tags in the head
157
+ - ` upsertHeadInlineScripts(scripts: ScriptInlineItem []) ` : Updates or inserts inline script tags in the head
158
158
- ` upsertBodyScripts(scripts: ScriptItem[]) ` : Updates or inserts script tags in the body
159
159
- ` serialize() ` : Converts the modified document back to HTML string
160
160
@@ -205,7 +205,7 @@ interface ScriptItem extends HtmlItemBase {
205
205
nonce? : string ;
206
206
}
207
207
208
- interface ScriptionInlineItem extends HtmlItemBase {
208
+ interface ScriptInlineItem extends HtmlItemBase {
209
209
content: string ;
210
210
}
211
211
@@ -222,7 +222,7 @@ interface TemplateOptions {
222
222
headStyles? : StyleItem [];
223
223
headInlineStyles? : StyleInlineItem [];
224
224
headScripts? : ScriptItem [];
225
- headInlineScripts? : ScriptionInlineItem [];
225
+ headInlineScripts? : ScriptInlineItem [];
226
226
bodyScripts? : ScriptItem [];
227
227
}
228
228
```
Original file line number Diff line number Diff line change 1
1
import type { DefaultTreeAdapterTypes } from 'parse5' ;
2
2
import { serialize } from 'parse5' ;
3
3
import type {
4
- ScriptionInlineItem ,
4
+ ScriptInlineItem ,
5
5
ScriptItem ,
6
6
StyleInlineItem ,
7
7
StyleItem ,
@@ -98,9 +98,7 @@ export class TemplateParser {
98
98
* @param scripts - The scripts to upsert
99
99
* @returns The TemplateParser instance
100
100
*/
101
- public upsertHeadInlineScripts (
102
- scripts : ScriptionInlineItem [ ]
103
- ) : TemplateParser {
101
+ public upsertHeadInlineScripts ( scripts : ScriptInlineItem [ ] ) : TemplateParser {
104
102
upsertHeadInlineScripts ( this . body , scripts ) ;
105
103
return this ;
106
104
}
Original file line number Diff line number Diff line change 1
1
import { type DefaultTreeAdapterTypes , parseFragment } from 'parse5' ;
2
- import type { ScriptionInlineItem } from '../types.js' ;
2
+ import type { ScriptInlineItem } from '../types.js' ;
3
3
4
4
/**
5
5
* Upsert the inline scripts
@@ -8,7 +8,7 @@ import type { ScriptionInlineItem } from '../types.js';
8
8
*/
9
9
export const upsertHeadInlineScripts = (
10
10
head : DefaultTreeAdapterTypes . Element ,
11
- scripts : ScriptionInlineItem [ ]
11
+ scripts : ScriptInlineItem [ ]
12
12
) => {
13
13
// Remove existing inline scripts with matching content
14
14
scripts . forEach ( ( script ) => {
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ export type StyleInlineItem = HtmlItemBase & {
42
42
/**
43
43
* The inline script item
44
44
*/
45
- export type ScriptionInlineItem = HtmlItemBase & {
45
+ export type ScriptInlineItem = HtmlItemBase & {
46
46
/**
47
47
* The content of the script
48
48
*/
@@ -129,7 +129,7 @@ export interface TemplateOptions {
129
129
/**
130
130
* The head inline scripts
131
131
*/
132
- headInlineScripts ?: ScriptionInlineItem [ ] ;
132
+ headInlineScripts ?: ScriptInlineItem [ ] ;
133
133
/**
134
134
* The head inline styles
135
135
*/
Original file line number Diff line number Diff line change 1
1
import { type DefaultTreeAdapterTypes } from 'parse5' ;
2
2
import { upsertHeadInlineScripts } from '../../src/parser/upsertHeadInlineScripts.js' ;
3
- import type { ScriptionInlineItem } from '../../src/types.js' ;
3
+ import type { ScriptInlineItem } from '../../src/types.js' ;
4
4
import { parseDocument } from '../../src/utils/parseDocument.js' ;
5
5
6
6
describe ( 'upsertHeadInlineScripts' , ( ) => {
7
- const createScripts = ( contents : string [ ] ) : ScriptionInlineItem [ ] => {
7
+ const createScripts = ( contents : string [ ] ) : ScriptInlineItem [ ] => {
8
8
return contents . map ( ( content , index ) => ( {
9
9
id : `script-${ index } ` ,
10
10
position : 'beginning' ,
You can’t perform that action at this time.
0 commit comments