fix: Ensure attributes are lowercased when checking (#1183)
* fix: Ensure attributes are lowercased when checking * add changeset * fix to lower case * Apply formatting changes --------- Co-authored-by: mydea <mydea@users.noreply.github.com>
This commit is contained in:
@@ -169,7 +169,7 @@ export function maskInputValue({
|
||||
maskInputFn?: MaskInputFn;
|
||||
}): string {
|
||||
let text = value || '';
|
||||
const actualType = type && type.toLowerCase();
|
||||
const actualType = type && toLowerCase(type);
|
||||
|
||||
if (
|
||||
maskInputOptions[tagName.toLowerCase() as keyof MaskInputOptions] ||
|
||||
@@ -184,6 +184,10 @@ export function maskInputValue({
|
||||
return text;
|
||||
}
|
||||
|
||||
export function toLowerCase<T extends string>(str: T): Lowercase<T> {
|
||||
return str.toLowerCase() as unknown as Lowercase<T>;
|
||||
}
|
||||
|
||||
const ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';
|
||||
type PatchedGetImageData = {
|
||||
[ORIGINAL_ATTRIBUTE_NAME]: CanvasImageData['getImageData'];
|
||||
@@ -265,6 +269,6 @@ export function getInputType(element: HTMLElement): Lowercase<string> | null {
|
||||
? 'password'
|
||||
: type
|
||||
? // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
||||
(type.toLowerCase() as Lowercase<string>)
|
||||
toLowerCase(type)
|
||||
: null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user