perf(schema-org): remove ohash and defu dependencies#605
Merged
harlan-zw merged 6 commits intoNov 13, 2025
Merged
Conversation
- Replaced ohash with existing custom hashCode implementation - Replaced createDefu with custom merge logic in util.ts - Replaced defu with custom mergeObjects utility in plugin.ts - Removed both dependencies from package.json (~3.5KB size reduction)
- Removed variadic arguments from merge (only called with 2 args) - Removed redundant Array.isArray check in recursive call - Extracted isNestedObject check for better readability - Simplified conditional logic and formatting
The merge function was being called with arguments in the wrong order, causing old values to overwrite new values instead of the reverse. This caused deduplication and merge logic to fail in tests. Fixed by swapping the order to merge(old, new) so new values properly override old values during node deduplication.
Removed unused TypeScript error suppression comments that were causing build failures. The code is valid TypeScript and doesn't need these directives.
Fixed TypeScript error TS18046: 'item' is of type 'unknown' by adding explicit type annotation to the arrow function parameter in uniqueBy call.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
π Linked issue
β Type of change
π Description
Replaced ohash with existing custom hashCode implementation