From 4fa5eeb8bb484e2d1f5abec6e3fffe48ebc8ba40 Mon Sep 17 00:00:00 2001
From: Sergei Zharinov <zharinov@users.noreply.github.com>
Date: Sun, 6 Feb 2022 11:03:07 +0300
Subject: [PATCH] refactor(util/template): Strict null checks (#14031)

---
 lib/util/template/index.ts | 6 ++++--
 tsconfig.strict.json       | 1 -
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/util/template/index.ts b/lib/util/template/index.ts
index 8c0be36eb0..2bf1bc75af 100644
--- a/lib/util/template/index.ts
+++ b/lib/util/template/index.ts
@@ -149,9 +149,11 @@ const allowedFieldsList = Object.keys(allowedFields)
 
 type CompileInput = Record<string, unknown>;
 
-function getFilteredObject(input: CompileInput): any {
+type FilteredObject = Record<string, CompileInput | CompileInput[] | unknown>;
+
+function getFilteredObject(input: CompileInput): FilteredObject {
   const obj = clone(input);
-  const res = {};
+  const res: FilteredObject = {};
   const allAllowed = [
     ...Object.keys(allowedFields),
     ...exposedConfigOptions,
diff --git a/tsconfig.strict.json b/tsconfig.strict.json
index be31c78ea0..ba807ea8f8 100644
--- a/tsconfig.strict.json
+++ b/tsconfig.strict.json
@@ -385,7 +385,6 @@
     "lib/util/ignore.ts",
     "lib/util/merge-confidence/index.ts",
     "lib/util/package-rules.ts",
-    "lib/util/template/index.ts",
     "lib/versioning/api.ts",
     "lib/versioning/aws-machine-image/index.ts",
     "lib/versioning/common.ts",
-- 
GitLab