From b9fb8b873ec63c71895e35c4e91ab2b850d2a9a6 Mon Sep 17 00:00:00 2001 From: ahmedhanafy725 Date: Tue, 10 Oct 2023 11:27:25 +0300 Subject: [PATCH] Apply some formating --- packages/grid_client/src/high_level/network.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/grid_client/src/high_level/network.ts b/packages/grid_client/src/high_level/network.ts index 35b5e4c78c..ba5da767d3 100644 --- a/packages/grid_client/src/high_level/network.ts +++ b/packages/grid_client/src/high_level/network.ts @@ -1,7 +1,7 @@ import { Addr } from "netaddr"; import { DeploymentFactory, Network } from "../primitives"; -import { WorkloadTypes } from "../zos"; +import { WorkloadTypes, Znet } from "../zos"; import { HighLevelBase } from "./base"; import { Operations, TwinDeployment } from "./models"; @@ -33,14 +33,12 @@ class NetworkHL extends HighLevelBase { // update network if it's already exist for (const deployment of network.deployments) { const d = await deploymentFactory.fromObj(deployment); - for (const workload of d["workloads"]) { - if ( - workload["type"] !== WorkloadTypes.network || - !Addr(network.ipRange).contains(Addr(workload["data"]["subnet"])) - ) { + for (const workload of d.workloads) { + const data = workload.data as Znet; + if (workload.type !== WorkloadTypes.network || !Addr(network.ipRange).contains(Addr(data.subnet))) { continue; } - workload.data = network.updateNetwork(workload["data"]); + workload.data = network.updateNetwork(data); workload.version += 1; break; }