Skip to content

Commit cf5c345

Browse files
committed
add typings script to prepack
1 parent 4bf3073 commit cf5c345

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "rrweb's component to take a snapshot of DOM, aka DOM serializer",
55
"scripts": {
66
"prepare": "npm run prepack",
7-
"prepack": "npm run bundle",
7+
"prepack": "npm run bundle && npm run typings",
88
"test": "cross-env TS_NODE_CACHE=false TS_NODE_FILES=true mocha -r ts-node/register test/**/*.ts",
99
"bundle": "rollup --config",
1010
"typings": "tsc -d --declarationDir typings"

src/snapshot.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,11 @@ export function transformAttribute(
165165
// relative path in attribute
166166
if (name === 'src' || ((name === 'href' || name === 'xlink:href') && value)) {
167167
return absoluteToDoc(doc, value);
168-
} else if (name === 'background' && value && (tagName === 'table' || tagName == 'td' || tagName == 'th')) {
168+
} else if (
169+
name === 'background' &&
170+
value &&
171+
(tagName === 'table' || tagName === 'td' || tagName === 'th')
172+
) {
169173
return absoluteToDoc(doc, value);
170174
} else if (name === 'srcset' && value) {
171175
return getAbsoluteSrcsetString(doc, value);

0 commit comments

Comments
 (0)