Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
falsandtru committed Sep 6, 2023
1 parent 1ef9120 commit 1939d8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/layer/domain/router/module/update/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ function evaluate(
export { evaluate as _evaluate }

export function escape(script: HTMLScriptElement): () => void {
const src: string | null = script.hasAttribute('src') ? script.getAttribute('src') : null;
const src = script.getAttribute('src');
const code = script.text;
script.removeAttribute('src');
script.text = '';
return () => {
script.text = ' ';
script.text = code;
typeof src === 'string' && void script.setAttribute('src', src);
src !== null && script.setAttribute('src', src);
};
}

Expand Down

0 comments on commit 1939d8e

Please sign in to comment.