Skip to content

Conversation

ashphy
Copy link
Owner

@ashphy ashphy commented Sep 10, 2025

ref #28

Adds a new pathSegments() method to JSONPathJS that returns path segments as arrays of strings and numbers instead of JSONPath strings.
This provides structured access to path components for programmatic use cases.

API Examples

const pathSegmentsResult = query.pathSegments({
	users: [{ name: "John Doe" }, { name: "Jane Doe" }],
});

// [
// 	{ value: "John Doe", segments: ["users", 0, "name"] },
// 	{ value: "Jane Doe", segments: ["users", 1, "name"] },
// ];
console.log(pathSegmentsResult);

@ashphy ashphy force-pushed the feature/path-segments branch from 356762d to 5b28b1d Compare September 10, 2025 15:07
@ashphy ashphy marked this pull request as ready for review September 11, 2025 14:41
@ashphy ashphy requested a review from Copilot September 11, 2025 14:41
Copilot

This comment was marked as outdated.

@ashphy ashphy force-pushed the feature/path-segments branch from 5b28b1d to cb207c7 Compare September 11, 2025 14:42
@ashphy ashphy requested a review from Copilot September 11, 2025 14:44
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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ashphy ashphy force-pushed the feature/path-segments branch from cb207c7 to 6d4c471 Compare September 11, 2025 15:26
@ashphy ashphy merged commit 286c556 into main Sep 11, 2025
10 checks passed
@ashphy ashphy deleted the feature/path-segments branch September 11, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant