mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: fix some anys pt.2 (#53928)
* correctly type some more any's * undo this change for now...
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
/*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user