MCPcopy Create free account
hub / github.com/dataform-co/dataform / equals

Method equals

sqlx/lexer.ts:267–288  ·  view source on GitHub ↗
(other: SyntaxTreeNode)

Source from the content-addressed store, hash-verified

265 }
266
267 public equals(other: SyntaxTreeNode): boolean {
268 if (this.type !== other.type) {
269 return false;
270 }
271 if (this.allChildren.length !== other.children().length) {
272 return false;
273 }
274
275 const areEqual = (first: string | SyntaxTreeNode, second: string | SyntaxTreeNode) => {
276 if (typeof first !== typeof second) {
277 return false;
278 }
279 if (typeof first === "string" || typeof second === "string") {
280 return first === second;
281 }
282 return first.equals(second);
283 };
284 if (this.allChildren.some((child, index) => !areEqual(child, other.children()[index]))) {
285 return false;
286 }
287 return true;
288 }
289}
290
291function buildSqlxLexer(): { [x: string]: moo.Rules } {

Callers 15

main_test.tsFile · 0.80
test_test.tsFile · 0.80
table_test.tsFile · 0.80
assertion_test.tsFile · 0.80
index_test.tsFile · 0.80
operation_test.tsFile · 0.80
notebook_test.tsFile · 0.80
view_test.tsFile · 0.80

Calls 1

childrenMethod · 0.80

Tested by

no test coverage detected