diff --git a/ts/ui/safe/SafeMethods.ts b/ts/ui/safe/SafeMethods.ts index 4e7380fdc..f7175e92d 100644 --- a/ts/ui/safe/SafeMethods.ts +++ b/ts/ui/safe/SafeMethods.ts @@ -242,15 +242,15 @@ export const SafeMethods: {[name: string]: FilterFunction} = { * * @param {Safe} safe The Safe object being used * @param {string} size The script size multiplier to test - * @return {number} The sanitized size + * @return {string} The sanitized size * * @template N The HTMLElement node class * @template T The Text node class * @template D The Document class */ - filterSizeMultiplier(safe: Safe, size: string): number { + filterSizeMultiplier(safe: Safe, size: string): string { const [m, M] = safe.options.scriptsizemultiplierRange || [-Infinity, Infinity]; - return Math.min(M, Math.max(m, parseFloat(size))); + return Math.min(M, Math.max(m, parseFloat(size))).toString(); }, /** @@ -258,15 +258,15 @@ export const SafeMethods: {[name: string]: FilterFunction} = { * * @param {Safe} safe The Safe object being used * @param {string} size The scriptlevel to test - * @return {number|null} The sanitized scriptlevel or null + * @return {string|null} The sanitized scriptlevel or null * * @template N The HTMLElement node class * @template T The Text node class * @template D The Document class */ - filterScriptLevel(safe: Safe, level: string): number | null { + filterScriptLevel(safe: Safe, level: string): string | null { const [m, M] = safe.options.scriptlevelRange || [-Infinity, Infinity]; - return Math.min(M, Math.max(m, parseInt(level))); + return Math.min(M, Math.max(m, parseInt(level))).toString(); }, /**