Skip to content

Commit

Permalink
fix: guard against empty patch array (#994)
Browse files Browse the repository at this point in the history
* fix: guard against empty patch array

* chore: remove change

* fix: guard against empty patch array

* chore: try update node

* chore: try update node

* chore: downgrade we
  • Loading branch information
Caele authored Jan 17, 2024
1 parent b894ba6 commit 2e66cc8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
11 changes: 5 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ defaults: &defaults
working_directory: ~/enigma.js
# Available images https://hub.docker.com/r/circleci/node/tags/
docker:
- image: circleci/node:17.2.0
- image: cimg/node:21.5.0

jobs:
install:
<<: *defaults
Expand All @@ -25,7 +25,7 @@ jobs:
command: npm run -s lint
- persist_to_workspace:
root: ~/enigma.js
paths:
paths:
- .
check-api-specs:
<<: *defaults
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
name: Run API Compliance
command: >
VER=v$(cat version.txt)
docker run --volumes-from specs
-e SPEC_PATHS="0f0b4c98-db9c-46c7-8958-2a98bd15a946@/specs/api-spec.json"
-e COMMIT_SHA="$CIRCLE_SHA1"
Expand All @@ -106,7 +106,7 @@ workflows:
jobs:
- install
- check-api-specs:
requires:
requires:
- install
- build:
requires:
Expand All @@ -115,4 +115,3 @@ workflows:
context: api-compliance
requires:
- check-api-specs

14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@
"rollup-plugin-node-resolve": "5.2.0",
"rollup-plugin-terser": "7.0.2",
"scriptappy-from-jsdoc": "0.7.0",
"ws": "8.16.0"
"ws": "8.13.0"
}
}
2 changes: 1 addition & 1 deletion src/interceptors/delta-response-interceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const patchValue = (session, handle, cacheId, patches) => {
const cache = getHandleCache(session, handle);
let entry = cache.get(cacheId);
if (typeof entry === 'undefined') {
entry = Array.isArray(patches[0].value) ? [] : {};
entry = patches[0] && Array.isArray(patches[0].value) ? [] : {};
}
if (patches.length) {
if (patches[0].path === '/' && typeof patches[0].value !== 'object') {
Expand Down

0 comments on commit 2e66cc8

Please sign in to comment.