File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,43 @@ class OverrideSet {
4545 }
4646 }
4747
48+ childrenAreEqual ( other ) {
49+ if ( this . children . size !== other . children . size ) {
50+ return false
51+ }
52+ for ( const [ key ] of this . children ) {
53+ if ( ! other . children . has ( key ) ) {
54+ return false
55+ }
56+ if ( this . children . get ( key ) . value !== other . children . get ( key ) . value ) {
57+ return false
58+ }
59+ if ( ! this . children . get ( key ) . childrenAreEqual ( other . children . get ( key ) ) ) {
60+ return false
61+ }
62+ }
63+ return true
64+ }
65+
66+ isEqual ( other ) {
67+ if ( this === other ) {
68+ return true
69+ }
70+ if ( ! other ) {
71+ return false
72+ }
73+ if ( this . key !== other . key || this . value !== other . value ) {
74+ return false
75+ }
76+ if ( ! this . childrenAreEqual ( other ) ) {
77+ return false
78+ }
79+ if ( ! this . parent ) {
80+ return ! other . parent
81+ }
82+ return this . parent . isEqual ( other . parent )
83+ }
84+
4885 getEdgeRule ( edge ) {
4986 for ( const rule of this . ruleset . values ( ) ) {
5087 if ( rule . name !== edge . name ) {
You can’t perform that action at this time.
0 commit comments