File tree 1 file changed +5
-5
lines changed
packages/lexical-mark/src
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export type SerializedMarkNode = Spread<
32
32
/** @noInheritDoc */
33
33
export class MarkNode extends ElementNode {
34
34
/** @internal */
35
- __ids : Array < string > ;
35
+ __ids : readonly string [ ] ;
36
36
37
37
static getType ( ) : string {
38
38
return 'mark' ;
@@ -57,13 +57,13 @@ export class MarkNode extends ElementNode {
57
57
exportJSON ( ) : SerializedMarkNode {
58
58
return {
59
59
...super . exportJSON ( ) ,
60
- ids : this . getIDs ( ) ,
60
+ ids : Array . from ( this . getIDs ( ) ) ,
61
61
type : 'mark' ,
62
62
version : 1 ,
63
63
} ;
64
64
}
65
65
66
- constructor ( ids : Array < string > , key ?: NodeKey ) {
66
+ constructor ( ids : readonly string [ ] , key ?: NodeKey ) {
67
67
super ( key ) ;
68
68
this . __ids = ids || [ ] ;
69
69
}
@@ -112,7 +112,7 @@ export class MarkNode extends ElementNode {
112
112
113
113
getIDs ( ) : Array < string > {
114
114
const self = this . getLatest ( ) ;
115
- return $isMarkNode ( self ) ? self . __ids : [ ] ;
115
+ return $isMarkNode ( self ) ? Array . from ( self . __ids ) : [ ] ;
116
116
}
117
117
118
118
addID ( id : string ) : void {
@@ -197,7 +197,7 @@ export class MarkNode extends ElementNode {
197
197
}
198
198
}
199
199
200
- export function $createMarkNode ( ids : Array < string > ) : MarkNode {
200
+ export function $createMarkNode ( ids : readonly string [ ] ) : MarkNode {
201
201
return $applyNodeReplacement ( new MarkNode ( ids ) ) ;
202
202
}
203
203
You can’t perform that action at this time.
0 commit comments