Skip to content

Commit

Permalink
deps: issues with dompurify imports
Browse files Browse the repository at this point in the history
  • Loading branch information
giannif committed Apr 12, 2024
1 parent 27d1924 commit d94c950
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
},
"dependencies": {
"@giphy/js-types": "*",
"dompurify": "2.2.2",
"dompurify": "3.1.0",
"uuid": "^9.0.0"
},
"devDependencies": {
"@types/dompurify": "^2.0.4",
"@types/uuid": "^8.3.0",
"typescript": "^5.0.4"
}
}
}
4 changes: 2 additions & 2 deletions packages/util/src/tracking-pixel.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { sanitize } from 'dompurify'
import DOMPurify from 'dompurify'

const injectTrackingPixel = (tags: string[] = []) => {
tags.forEach((tag) => {
const el = document.createElement('html')
tag = tag.replace('%%CACHEBUSTER%%', Date.now().toString())
el.innerHTML = sanitize(tag)
el.innerHTML = DOMPurify.sanitize(tag)
const pixel = el.querySelector('img')
if (pixel) {
document?.querySelector('head')?.appendChild(pixel)
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2553,7 +2553,7 @@ __metadata:
"@giphy/js-types": "*"
"@types/dompurify": ^2.0.4
"@types/uuid": ^8.3.0
dompurify: ^2.2.2
dompurify: 3.1.0
typescript: ^5.0.4
uuid: ^9.0.0
languageName: unknown
Expand Down Expand Up @@ -9659,10 +9659,10 @@ __metadata:
languageName: node
linkType: hard

"dompurify@npm:^2.2.2":
version: 2.4.7
resolution: "dompurify@npm:2.4.7"
checksum: 13c047e772a1998348191554dda403950d45ef2ec75fa0b9915cc179ccea0a39ef780d283109bd72cf83a2a085af6c77664281d4d0106a737bc5f39906364efe
"dompurify@npm:3.1.0":
version: 3.1.0
resolution: "dompurify@npm:3.1.0"
checksum: 06fc76607cd076e394b2ea5479ab6f0407b8fedb6877ae95e94207b878365e5e1cd914055dacce152a5f419818afb8d4cd284b780246cf35363f0747c179a0ba
languageName: node
linkType: hard

Expand Down

0 comments on commit d94c950

Please sign in to comment.