From 69aac586fe955e1e5966a1f21be4b096e45a4010 Mon Sep 17 00:00:00 2001 From: adrianbatuto Date: Mon, 15 May 2023 13:59:53 +0800 Subject: [PATCH] style: 2021-09-20 linter warnings batch 17 / 26; part 2 Fixes #2092 Signed-off-by: adrianbatuto --- .../converter/bamboo-harvest-converter.ts | 18 +++++++++++------- .../model/converter/bookshelf-converter.ts | 12 +++++++----- .../bamboo-harvest-detail.page.ts | 4 ++-- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/model/converter/bamboo-harvest-converter.ts b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/model/converter/bamboo-harvest-converter.ts index 89f5ce6ae84..7aa85808648 100644 --- a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/model/converter/bamboo-harvest-converter.ts +++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/model/converter/bamboo-harvest-converter.ts @@ -21,17 +21,21 @@ export class BambooHarvestConverter { * @param arr The array containing the values of properties describing a * `BambooHarvest` model entity. */ - public static ofSolidityStruct(arr: any[]): BambooHarvest { + public static ofSolidityStruct(arr: unknown[]): BambooHarvest { return { - id: arr[BambooHarvestConverter.SOLIDITY_FIELD_ID], - location: arr[BambooHarvestConverter.SOLIDITY_FIELD_LOCATION], - startedAt: arr[BambooHarvestConverter.SOLIDITY_FIELD_STARTED_AT], - endedAt: arr[BambooHarvestConverter.SOLIDITY_FIELD_ENDED_AT], - harvester: arr[BambooHarvestConverter.SOLIDITY_FIELD_HARVESTER], + id: arr[BambooHarvestConverter.SOLIDITY_FIELD_ID] as string, + location: arr[BambooHarvestConverter.SOLIDITY_FIELD_LOCATION] as string, + startedAt: arr[ + BambooHarvestConverter.SOLIDITY_FIELD_STARTED_AT + ] as string, + endedAt: arr[BambooHarvestConverter.SOLIDITY_FIELD_ENDED_AT] as string, + harvester: arr[BambooHarvestConverter.SOLIDITY_FIELD_HARVESTER] as string, }; } - public static ofSolidityStructList(arrayOfArrays: any[][]): BambooHarvest[] { + public static ofSolidityStructList( + arrayOfArrays: unknown[][], + ): BambooHarvest[] { return arrayOfArrays.map(BambooHarvestConverter.ofSolidityStruct); } } diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/model/converter/bookshelf-converter.ts b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/model/converter/bookshelf-converter.ts index 55d75f35795..7b74c5d6ef4 100644 --- a/examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/model/converter/bookshelf-converter.ts +++ b/examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/model/converter/bookshelf-converter.ts @@ -19,15 +19,17 @@ export class BookshelfConverter { * @param arr The array containing the values of properties describing a * `Bookshelf` model entity. */ - public static ofSolidityStruct(arr: any[]): Bookshelf { + public static ofSolidityStruct(arr: unknown[]): Bookshelf { return { - id: arr[BookshelfConverter.SOLIDITY_FIELD_ID], - shelfCount: arr[BookshelfConverter.SOLIDITY_FIELD_SHELF_COUNT], - bambooHarvestId: arr[BookshelfConverter.SOLIDITY_FIELD_BAMBOO_HARVEST_ID], + id: arr[BookshelfConverter.SOLIDITY_FIELD_ID] as string, + shelfCount: arr[BookshelfConverter.SOLIDITY_FIELD_SHELF_COUNT] as number, + bambooHarvestId: arr[ + BookshelfConverter.SOLIDITY_FIELD_BAMBOO_HARVEST_ID + ] as string, }; } - public static ofSolidityStructList(arrayOfArrays: any[][]): Bookshelf[] { + public static ofSolidityStructList(arrayOfArrays: unknown[][]): Bookshelf[] { return arrayOfArrays.map(BookshelfConverter.ofSolidityStruct); } } diff --git a/examples/cactus-example-supply-chain-frontend/src/app/bamboo-harvest/bamboo-harvest-detail/bamboo-harvest-detail.page.ts b/examples/cactus-example-supply-chain-frontend/src/app/bamboo-harvest/bamboo-harvest-detail/bamboo-harvest-detail.page.ts index b09ca73130c..9951e93eadf 100644 --- a/examples/cactus-example-supply-chain-frontend/src/app/bamboo-harvest/bamboo-harvest-detail/bamboo-harvest-detail.page.ts +++ b/examples/cactus-example-supply-chain-frontend/src/app/bamboo-harvest/bamboo-harvest-detail/bamboo-harvest-detail.page.ts @@ -52,9 +52,9 @@ export class BambooHarvestDetailPage implements OnInit { }); } - public onClickFormSubmit(value: any): void { + public onClickFormSubmit(value: unknown): void { this.log.debug("form submitted", value); - this.bambooHarvest = value; + this.bambooHarvest = value as BambooHarvest; this.modalController.dismiss(this.bambooHarvest); }