mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-30 01:32:44 +00:00
Update model and add invalidated cycle
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
type PathElement = (string | number)
|
||||
|
||||
export class Path {
|
||||
export class Path implements Iterable<PathElement> {
|
||||
private arr: PathElement[]
|
||||
|
||||
constructor(arr?: PathElement[]) {
|
||||
@@ -23,4 +23,14 @@ export class Path {
|
||||
copy(): Path {
|
||||
return new Path([...this.arr])
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
return `[${this.arr.map(e => e.toString()).join(', ')}]`
|
||||
}
|
||||
|
||||
*[Symbol.iterator]() {
|
||||
for (const e of this.arr) {
|
||||
yield e
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user