Skip to content

Conversation

char0n
Copy link
Member

@char0n char0n commented Mar 16, 2025

Refs #13

@char0n char0n requested a review from Copilot March 16, 2025 14:26
@char0n char0n self-assigned this Mar 16, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for evaluation realms to the JSON Pointer evaluation process, allowing custom handling for arrays and objects during evaluation. Key changes include:

  • Moving the evaluate implementation to use a realm abstraction for array and object operations.
  • Adding a new EvaluationRealm abstract class and a JSONEvaluationRealm implementation.
  • Updating tests and documentation to support the new evaluation realms feature.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/evaluate/index.js Rewrites evaluate to delegate array/object operations to a realm.
src/evaluate/realms/realm.js Introduces an abstract EvaluationRealm class for custom implementations.
src/evaluate/realms/json.js Implements a JSON-specific evaluation realm.
test/evaluate.js Adds tests for custom realm usage and updates evaluator tests.
src/index.js Updates exports to include the new evaluate and realm modules.
README.md Documents the new Evaluation Realms feature.
src/evaluate.js Removes legacy evaluate implementation.
Comments suppressed due to low confidence (1)

src/evaluate/index.js:39

  • Consider ensuring that the reference token passed to realm.evaluate is of the expected type (e.g., converting the number to a string if required) for consistency between different realm implementations.
return realm.evaluate(current, realm.sizeOf(current));

@char0n char0n merged commit b3b9347 into main Mar 16, 2025
4 checks passed
@char0n char0n deleted the char0n/13-realm-support branch March 16, 2025 21:17
char0n pushed a commit that referenced this pull request Mar 16, 2025
# [1.3.0](v1.2.0...v1.3.0) (2025-03-16)

### Features

* add support for evaluation realms ([#14](#14)) ([b3b9347](b3b9347)), closes [#13](#13)
@char0n
Copy link
Member Author

char0n commented Mar 16, 2025

🎉 This PR is included in version 1.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant