Skip to content

Commit ac4f5d9

Browse files
authored
fix splitCssText and another attempt at labelling versions (#26)
1 parent eaec896 commit ac4f5d9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.github/workflows/label-version-bump.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
if: steps.bump-type.outputs.bump-type != 'null'
5757
run: |
5858
OLD_VERSION=$(jq ".version" package.json -r)
59-
NEW_VERSION=$(yarn run semver $OLD_VERSION -i ${{ steps.bump-type.outputs.bump-type }})
59+
NEW_VERSION=$(semver $OLD_VERSION -i ${{ steps.bump-type.outputs.bump-type }})
6060
echo "old-version=$OLD_VERSION" >> "$GITHUB_OUTPUT"
6161
echo "new-version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
6262

packages/rrweb-snapshot/src/utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,12 +474,12 @@ export function splitCssText(
474474
cssText: string,
475475
style: HTMLStyleElement,
476476
): string[] {
477+
const og = cssText;
477478
if (splitCache.has(cssText)) {
478479
// we know there's a result
479480
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
480481
return splitCache.get(cssText)!;
481482
}
482-
const og = cssText;
483483
const childNodes = Array.from(style.childNodes);
484484
const splits: string[] = [];
485485
let iterLimit = 0;
@@ -554,7 +554,9 @@ export function splitCssText(
554554
}
555555
}
556556
splits.push(cssText); // either the full thing if no splits were found, or the last split
557-
splitCache.set(og, splits);
557+
if (og) {
558+
splitCache.set(og, splits);
559+
}
558560
return splits;
559561
}
560562

0 commit comments

Comments
 (0)