| 148 | * @returns {boolean} true, when they are equal |
| 149 | */ |
| 150 | const runtimeEqual = (a, b) => { |
| 151 | if (a === b) { |
| 152 | return true; |
| 153 | } else if ( |
| 154 | a === undefined || |
| 155 | b === undefined || |
| 156 | typeof a === "string" || |
| 157 | typeof b === "string" |
| 158 | ) { |
| 159 | return false; |
| 160 | } else if (a.size !== b.size) { |
| 161 | return false; |
| 162 | } |
| 163 | a.sort(); |
| 164 | b.sort(); |
| 165 | const aIt = a[Symbol.iterator](); |
| 166 | const bIt = b[Symbol.iterator](); |
| 167 | for (;;) { |
| 168 | const aV = aIt.next(); |
| 169 | if (aV.done) return true; |
| 170 | const bV = bIt.next(); |
| 171 | if (aV.value !== bV.value) return false; |
| 172 | } |
| 173 | }; |
| 174 | |
| 175 | /** |
| 176 | * Compares the provided values and returns their ordering. |