Chore: fix some anys pt.2 (#53928)

* correctly type some more any's

* undo this change for now...
This commit is contained in:
Ashley Harrison
2022-08-22 16:51:33 +01:00
committed by GitHub
parent 2b17e5354a
commit 3cf95d7eee
42 changed files with 113 additions and 190 deletions

View File

@@ -75,7 +75,7 @@ export const getStyles = (theme: GrafanaTheme2) => {
const jsonObjectOrArrayStartRegex = /^(\[|\{)/;
function parseIfComplexJson(value: any) {
function parseIfComplexJson(value: unknown) {
// if the value is a string representing actual json object or array, then use json-markup
if (typeof value === 'string' && jsonObjectOrArrayStartRegex.test(value)) {
// otherwise just return as is

View File

@@ -56,7 +56,7 @@ function stringSupplant(str: string, encodeFn: (unencoded: any) => string, map:
});
}
export function processTemplate(template: any, encodeFn: (unencoded: any) => string): ProcessedTemplate {
export function processTemplate(template: unknown, encodeFn: (unencoded: any) => string): ProcessedTemplate {
if (typeof template !== 'string') {
/*
@@ -76,10 +76,10 @@ export function processTemplate(template: any, encodeFn: (unencoded: any) => str
export function createTestFunction(entry: any) {
if (typeof entry === 'string') {
return (arg: any) => arg === entry;
return (arg: unknown) => arg === entry;
}
if (Array.isArray(entry)) {
return (arg: any) => entry.indexOf(arg) > -1;
return (arg: unknown) => entry.indexOf(arg) > -1;
}
/*