Commit b90eeb6 1 parent 7ac7e5f commit b90eeb6 Copy full SHA for b90eeb6
File tree 2 files changed +9
-11
lines changed
2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ import { FileSystemCache } from "./fsCache.js"
32
32
* @property {Array<"render" | "css:scoped"> } [currentTransformTypes]
33
33
*/
34
34
35
-
36
35
class AstSerializer {
37
36
constructor ( options = { } ) {
38
37
let { filePath } = Object . assign ( {
@@ -109,11 +108,6 @@ class AstSerializer {
109
108
110
109
static EOL = "\n" ;
111
110
112
- static prefixes = {
113
- props : "@" ,
114
- dynamic : ":" ,
115
- }
116
-
117
111
/* Custom HTML attributes */
118
112
static attrs = {
119
113
TYPE : "webc:type" ,
Original file line number Diff line number Diff line change 1
- import { AstSerializer } from "./ast.js" ;
2
1
import { ModuleScript } from "./moduleScript.cjs" ;
3
2
import { escapeAttribute } from 'entities/lib/escape.js' ;
4
3
5
4
class AttributeSerializer {
5
+ static prefixes = {
6
+ props : "@" ,
7
+ dynamic : ":" ,
8
+ }
9
+
6
10
// Merge multiple style/class attributes into a single one, operates on :dynamic and @prop but with transformed values
7
11
// Usage by: `getString` function when writing attributes to the HTML tag output
8
12
// Usage by: when generating data object for render functions
@@ -74,17 +78,17 @@ class AttributeSerializer {
74
78
}
75
79
76
80
static peekAttribute ( name ) {
77
- if ( name . startsWith ( AstSerializer . prefixes . props ) ) {
81
+ if ( name . startsWith ( AttributeSerializer . prefixes . props ) ) {
78
82
return {
79
- name : name . slice ( AstSerializer . prefixes . props . length ) ,
83
+ name : name . slice ( AttributeSerializer . prefixes . props . length ) ,
80
84
privacy : "private" , // property
81
85
evaluation : false ,
82
86
} ;
83
87
}
84
88
85
- if ( name . startsWith ( AstSerializer . prefixes . dynamic ) ) {
89
+ if ( name . startsWith ( AttributeSerializer . prefixes . dynamic ) ) {
86
90
return {
87
- name : name . slice ( AstSerializer . prefixes . dynamic . length ) ,
91
+ name : name . slice ( AttributeSerializer . prefixes . dynamic . length ) ,
88
92
privacy : "public" ,
89
93
evaluation : "script" ,
90
94
} ;
You can’t perform that action at this time.
0 commit comments