Skip to content

Commit

Permalink
chore: fix STRIPPED_INTEGRITY_TAG import warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
AtofStryker committed Aug 7, 2023
1 parent dad1546 commit 48bb07c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/runner/injection/patches/setAttribute.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { STRIPPED_INTEGRITY_TAG } from '@packages/rewriter/lib/constants.json'
import constants from '@packages/rewriter/lib/constants.json'

export const patchElementIntegrity = (window: Window) => {
const originalFormElementSetAttribute = window.HTMLScriptElement.prototype.setAttribute

window.HTMLScriptElement.prototype.setAttribute = function (qualifiedName, value) {
if (qualifiedName === 'integrity') {
qualifiedName = STRIPPED_INTEGRITY_TAG
qualifiedName = constants.STRIPPED_INTEGRITY_TAG
}

return originalFormElementSetAttribute.apply(this, [qualifiedName, value])
Expand All @@ -15,7 +15,7 @@ export const patchElementIntegrity = (window: Window) => {

window.HTMLLinkElement.prototype.setAttribute = function (qualifiedName, value) {
if (qualifiedName === 'integrity') {
qualifiedName = STRIPPED_INTEGRITY_TAG
qualifiedName = constants.STRIPPED_INTEGRITY_TAG
}

return originalAnchorElementSetAttribute.apply(this, [qualifiedName, value])
Expand Down

0 comments on commit 48bb07c

Please sign in to comment.