From 0dc3fe4b8e50ee6456d35d76beac007953d22fb3 Mon Sep 17 00:00:00 2001
From: poka <poka@p2p.legal>
Date: Thu, 7 Mar 2024 13:06:48 +0100
Subject: [PATCH] enh: replace loose equality with strict equality in
 TypeScript

---
 src/data_handler.ts | 2 +-
 src/giant-squid.ts  | 4 ++--
 src/main.ts         | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/data_handler.ts b/src/data_handler.ts
index 28023c6..b32e577 100644
--- a/src/data_handler.ts
+++ b/src/data_handler.ts
@@ -477,7 +477,7 @@ export class DataHandler {
       this.data.identities.delete(i.index); // prevent from trying to add twice
       identities.push(idty);
     }
-    if (identities.length == 0) {
+    if (identities.length === 0) {
       return;
     }
     // we are sure that all created identities actually do not already exist in database
diff --git a/src/giant-squid.ts b/src/giant-squid.ts
index 6aa0b9e..a2867e8 100644
--- a/src/giant-squid.ts
+++ b/src/giant-squid.ts
@@ -48,7 +48,7 @@ export async function saveBlock(ctx: ProcessorContext<StoreWithCache>, block: Bl
   });
 
   // We set the genesis timestamp based of first block timestamp
-  if (block.height == 1) {
+  if (block.height === 1) {
     const blockGenesis = await ctx.store.findOneByOrFail(model.Block, { height: 0 });
     blockGenesis.timestamp = new Date(block.timestamp! - 6000);
     await ctx.store.upsert(blockGenesis);
@@ -103,7 +103,7 @@ export async function saveCall(ctx: ProcessorContext<StoreWithCache>, call: Call
   block.callsCount += 1;
   await ctx.store.upsert(block);
 
-  if (call.address.length == 0) {
+  if (call.address.length === 0) {
     extrinsic.call = entity;
     await ctx.store.upsert(extrinsic);
   }
diff --git a/src/main.ts b/src/main.ts
index 8e82b1f..525b877 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -19,7 +19,7 @@ processor.run(new TypeormDatabaseWithCache(), async (ctx) => {
     // save the block header
     const genesisBlock = await saveBlock(ctx, header);
     // manage genesis state
-    if (header.height == 0) {
+    if (header.height === 0) {
       await saveGenesis(ctx, genesisBlock);
     }
     // save all extrinsics of the block
-- 
GitLab