-
Notifications
You must be signed in to change notification settings - Fork 1
Add object manipulation functions: merge, keys, values, flatten #17
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
Co-authored-by: Sander-Toonen <5106372+Sander-Toonen@users.noreply.github.com>
Sander-Toonen
left a comment
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.
Document the object functions.
Co-authored-by: Sander-Toonen <5106372+Sander-Toonen@users.noreply.github.com>
Added documentation for the object functions in |
Sander-Toonen
left a comment
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.
Make sure the language server also works with the new functions
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
This PR adds comprehensive object manipulation functions to the expression parser, enabling users to work with objects in their expressions. The implementation includes four new functions: merge, keys, values, and flatten, along with complete test coverage and documentation.
Changes:
- Added four object manipulation functions (
merge,keys,values,flatten) with proper error handling and type safety - Created comprehensive test suite with 23 test cases covering all functions and edge cases
- Updated documentation with clear descriptions, examples, and usage patterns
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/functions/object/operations.ts |
Implements the four object manipulation functions with proper validation and error handling |
src/functions/object/index.ts |
Exports all object manipulation functions |
src/functions/index.ts |
Re-exports object functions to make them available throughout the codebase |
src/parsing/parser.ts |
Imports and registers the new object functions in the parser |
test/functions/functions-object.ts |
Comprehensive test suite with 23 tests covering all functions and edge cases |
docs/syntax.md |
Documentation for the new object functions with clear examples and usage patterns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot Add language server support for the added functions |
|
@copilot Add language server support for the added functions |
Co-authored-by: Sander-Toonen <5106372+Sander-Toonen@users.noreply.github.com>
Adds a new
src/functions/objectdirectory with four object manipulation functions for the expression parser:merge(...objects)- Merges two or more objects together. Duplicate keys are overwritten by later arguments.keys(obj)- Returns an array of strings containing the keys of the object.values(obj)- Returns an array containing the values of the object.flatten(obj, separator?)- Flattens a nested object's keys using an optional separator (default:_). For example,{foo: {bar: 1}}becomes{foo_bar: 1}.Changes Made
src/functions/object/operations.tswith function implementationssrc/functions/object/index.tsto export object functionssrc/functions/index.tsto include object module exportsrc/parsing/parser.tsto register the new functionsdocs/syntax.mdsrc/language-service/language-service.documentation.tsTesting
test/functions/functions-object.tsSecurity Summary: No security vulnerabilities were discovered by CodeQL analysis.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.