-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix(deps): update dependency @trojs/deep-merge to v1.1.0 #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis update consolidates and simplifies the project's ESLint configuration by replacing multiple individual plugin imports and rule definitions with a single, centralized configuration sourced from the Changes
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
The PR updates the dependency @trojs/deep-merge to v1.1.0 for improved compatibility and dependency upgrades.
- Updates dependency versions and related tool configurations
- Minor formatting adjustment in tests
Files not reviewed (1)
- package.json: Language not supported
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🔭 Outside diff range comments (1)
package.json (1)
50-54:⚠️ Potential issueDependency version not updated – contradicts PR title
The PR is meant to upgrade
@trojs/deep-mergeto 1.1.0, butpackage.jsonstill specifies^1.0.0.
This prevents consumers from receiving the intended bug‑fixes and could mask breaking‑changes during CI.- "@trojs/deep-merge": "^1.0.0", + "@trojs/deep-merge": "^1.1.0",
🧹 Nitpick comments (3)
src/model.js (1)
32-34: Guard against schemas withoutproperties
Object.entries(schema.properties)will throw whenpropertiesisundefined.
Consider adding a fallback so the helper works for simpletype: 'object'schemas that omit thepropertiesfield.- Object.entries(schema.properties).map(createPropertyWithDefaultValue) + Object.entries(schema.properties ?? {}).map(createPropertyWithDefaultValue)package.json (1)
15-18: Ensure coverage directory exists before writinglcov.infoNode’s built‑in test runner will fail if the
coveragefolder does not exist.
Consider pre‑creating it in the script or switching the destination tocoverage/lcov.infowhile relying onmkdirpbehaviour.eslint.config.js (1)
20-24:rules.allmay be overly strictImporting
...rules.allenables every rule from every included plugin, including purely stylistic ones.
If the intention was to enforce only recommended/essential rules, replace withrules.recommendedor a curated subset to avoid noisy CI failures.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (4)
eslint.config.js(1 hunks)package.json(3 hunks)src/model.js(1 hunks)src/model.test.js(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/model.test.js (1)
src/model.js (1)
openapiToModel(36-98)
🔇 Additional comments (1)
src/model.js (1)
63-65: Check compatibility with@trojs/[email protected]
deepMerge()is invoked asdeepMerge(emptyObject, data).
If the updated library changed the argument order or default merge strategy, this could silently corrupt data. Please verify the new version still behaves as expected (left‑to‑right, second argument overriding the first).- const newData = deepMerge(emptyObject, data) + // ensure `data` overrides defaults after the upgrade to deep‑merge v1.1 + const newData = deepMerge(emptyObject, data)
| error.data, | ||
| { | ||
| baz: { | ||
| qux: '42' | ||
| } | ||
| } | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix error.data expectation – value type mismatch
The data handed to the constructor uses the number 42 (qux: 42), but the assertion expects a string ('42').
This causes a false‑negative test failure.
- assert.deepEqual(
- error.data,
- {
- baz: {
- qux: '42'
- }
- }
- )
+ assert.deepEqual(
+ error.data,
+ {
+ baz: {
+ qux: 42
+ }
+ }
+ )📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| error.data, | |
| { | |
| baz: { | |
| qux: '42' | |
| } | |
| } | |
| ) | |
| assert.deepEqual( | |
| error.data, | |
| { | |
| baz: { | |
| qux: 42 | |
| } | |
| } | |
| ) |
| error.newData, | ||
| { | ||
| bar: 42, | ||
| baz: { | ||
| quux: 3.14, | ||
| qux: '42' | ||
| }, | ||
| foo: 'bar' | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update error.newData expectation to match corrected input
After merging defaults, newData should also contain the number 42, not the string.
- baz: {
- quux: 3.14,
- qux: '42'
- },
+ baz: {
+ quux: 3.14,
+ qux: 42
+ },📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| error.newData, | |
| { | |
| bar: 42, | |
| baz: { | |
| quux: 3.14, | |
| qux: '42' | |
| }, | |
| foo: 'bar' | |
| } | |
| error.newData, | |
| { | |
| bar: 42, | |
| baz: { | |
| quux: 3.14, | |
| qux: 42 | |
| }, | |
| foo: 'bar' | |
| } |
| try { | ||
| new ExampleModel({ | ||
| baz: { | ||
| qux: 42 | ||
| } | ||
| }) | ||
| }) | ||
| } catch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Assert the error is actually thrown
The current try / catch block silently passes the test when the constructor does not throw.
Use assert.throws() (or at least add an explicit assert.fail() after the constructor call) so that the test fails when the expected validation error is missing.
- try {
- new ExampleModel({
- baz: {
- qux: 42
- }
- })
- } catch (error) {
+ assert.throws(() => {
+ new ExampleModel({
+ baz: {
+ qux: 42
+ }
+ })
+ }, /Invalid data/, 'Model should throw when data is invalid')
+
+ /** @type {any} */ const error = /** @type {any} */ (assert.throws.lastError)Committable suggestion skipped: line range outside the PR's diff.
This PR contains the following updates:
1.0.1->1.1.0Release Notes
trojs/deep-merge (@trojs/deep-merge)
v1.1.0Compare Source
What's Changed
Full Changelog: trojs/deep-merge@1.0.1...1.1.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.
Summary by CodeRabbit