From d86df0d3fc56740a3e429bf2177778564e39f754 Mon Sep 17 00:00:00 2001 From: Natalie Kay <35006220+shoosya@users.noreply.github.com> Date: Fri, 31 Oct 2025 16:11:19 -0400 Subject: [PATCH 1/2] Update styleSheetSerializer.js Add defensive guards for cases when node is null/undefined, prevent snapshots from failing when node is not an iterable. --- src/styleSheetSerializer.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/styleSheetSerializer.js b/src/styleSheetSerializer.js index 3714bfb..aa0748d 100644 --- a/src/styleSheetSerializer.js +++ b/src/styleSheetSerializer.js @@ -2,13 +2,19 @@ const css = require('@adobe/css-tools'); const { getCSS, getHashes } = require('./utils'); let cache = new WeakSet(); + const getNodes = (node, nodes = []) => { - if (typeof node === 'object') { - nodes.push(node); + if (!node || typeof node !== 'object') { + return nodes; } - if (node.children) { - Array.from(node.children).forEach((child) => getNodes(child, nodes)); + nodes.push(node); + + if (node.children && typeof node.children === 'object') { + try { + Array.from(node.children).forEach((child) => getNodes(child, nodes)); + } catch (_) { + } } return nodes; From 0048fed5b8ff50902ada679d5a6a79d07c33eb89 Mon Sep 17 00:00:00 2001 From: Natalie Kay <35006220+shoosya@users.noreply.github.com> Date: Fri, 31 Oct 2025 16:20:06 -0400 Subject: [PATCH 2/2] Update ci.yml Update deprecated actions/cache --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97f9903..12d27e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - name: Restore yarn cache - uses: actions/cache@v2 + uses: actions/cache@v4 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }}