From 8d7d2473d749746e38931e27c8044889b0ce3394 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Mon, 18 Oct 2021 23:48:37 -0700 Subject: [PATCH 1/3] feat(common): add Strings#isNonBlank() Signed-off-by: Peter Somogyvari --- packages/cactus-common/src/main/typescript/strings.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/cactus-common/src/main/typescript/strings.ts b/packages/cactus-common/src/main/typescript/strings.ts index 5493392572..51b74a0cc0 100644 --- a/packages/cactus-common/src/main/typescript/strings.ts +++ b/packages/cactus-common/src/main/typescript/strings.ts @@ -9,10 +9,17 @@ export class Strings { return source.replace(new RegExp(searchValue, "gm"), replaceValue); } - public static isString(val: any): boolean { + public static isString(val: any): val is string { return typeof val === "string" || val instanceof String; } + public static isNonBlank(val: unknown): val is string { + if (!Strings.isString(val)) { + return false; + } + return val.trim().length > 0; + } + public static dropNonPrintable(val: string): string { const fnTag = "Strings#dropNonPrintable()"; Checks.truthy(Strings.isString(val), `${fnTag} Strings.isString(val)`); From 09d3c02bbd2190abf66619272c916ea8822ab21e Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Wed, 20 Oct 2021 15:37:05 -0700 Subject: [PATCH 2/3] build: reset:node-modules script dry-run parameter dropped Epic facepalm once again, congratulations to Peter! The reset:node-modules script had one job, which was to delete all node_modules directories in the entire repo. It was on the right track, but the --dry-run flag was forgotten in among the CLI arguments so this whole time the script was not working *at all* because of it. Just brilliant... :-) Signed-off-by: Peter Somogyvari --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 499babe452..4f3f3b09ca 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "scripts": { "run-ci": "./tools/ci.sh", - "reset:node-modules": "del-cli --dry-run '**/node_modules'", + "reset:node-modules": "del-cli '**/node_modules'", "reset:git": "git clean -f -X", "reset:yarn-lock": "del-cli yarn.lock && yarn install --update-checksums --force", "reset": "run-s reset:git reset:node-modules reset:yarn-lock configure", From db0941e94bc8678d4bc7d0800d9c42b2363a5294 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Thu, 21 Oct 2021 12:50:40 -0700 Subject: [PATCH 3/3] test(connector-corda): skip deploy-cordapp-jars-to-nodes-v4.8 Related to #1469 Signed-off-by: Peter Somogyvari --- .../integration/deploy-cordapp-jars-to-nodes-v4.8.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/deploy-cordapp-jars-to-nodes-v4.8.test.ts b/packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/deploy-cordapp-jars-to-nodes-v4.8.test.ts index 5ec79a2c3c..f188a55413 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/deploy-cordapp-jars-to-nodes-v4.8.test.ts +++ b/packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/deploy-cordapp-jars-to-nodes-v4.8.test.ts @@ -35,7 +35,7 @@ import { K_CACTUS_CORDA_TOTAL_TX_COUNT } from "../../../main/typescript/promethe const logLevel: LogLevelDesc = "TRACE"; -test("Tests are passing on the JVM side", async (t: Test) => { +test.skip("Tests are passing on the JVM side", async (t: Test) => { test.onFailure(async () => { await Containers.logDiagnostics({ logLevel }); });