Skip to content

feat: add asPipe object support for making methods pipeable - #10

Merged
irony merged 3 commits into
mainfrom
fear/asPipeClasses
Oct 8, 2025
Merged

feat: add asPipe object support for making methods pipeable#10
irony merged 3 commits into
mainfrom
fear/asPipeClasses

Conversation

@irony

@irony irony commented Oct 8, 2025

Copy link
Copy Markdown
Owner
  • Enable asPipe to work with objects, making all their methods pipeable
  • Add destructuring support for Math, custom objects, and prototypes
  • Update documentation with examples and usage patterns
  • All tests passing with comprehensive coverage

- Enable asPipe to work with objects, making all their methods pipeable
- Add destructuring support for Math, custom objects, and prototypes
- Update documentation with examples and usage patterns
- All tests passing with comprehensive coverage
Copilot AI review requested due to automatic review settings October 8, 2025 20:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 support for using asPipe with objects to make all their methods pipeable, expanding beyond just functions. This enables destructuring of built-in objects like Math or custom objects to use their methods directly in pipelines.

  • Add object support to asPipe with automatic method binding and property passthrough
  • Update comments in stream.js for clarity and consistency
  • Add comprehensive tests for Math object destructuring and custom object usage

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
index.js Implements object support in asPipe with proxy-based method wrapping
stream.js Updates function comments for better clarity and consistency
test.js Adds comprehensive tests for object destructuring and method access
README.md Documents the new object support feature with examples and updated implementation

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

Comment thread README.md Outdated
Comment on lines +434 to +437
// fångar den pipeline som just byggdes av ett |-uttryck
const take = (_ignored) => {
const ctx = stack.pop();
return ctx?.token ?? _ignored; // om inget på stacken, returnera originalet

Copilot AI Oct 8, 2025

Copy link

Choose a reason for hiding this comment

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

The comment contains Swedish text instead of English. It should be translated to maintain consistency with the rest of the codebase.

Suggested change
// fångar den pipeline som just byggdes av ett |-uttryck
const take = (_ignored) => {
const ctx = stack.pop();
return ctx?.token ?? _ignored; // om inget på stacken, returnera originalet
// captures the pipeline that was just built by a | expression
const take = (_ignored) => {
const ctx = stack.pop();
return ctx?.token ?? _ignored; // if nothing is on the stack, return the original

Copilot uses AI. Check for mistakes.
Comment thread index.js Outdated
Comment thread index.js Outdated
irony and others added 2 commits October 8, 2025 22:29
…en i README

Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
@irony
irony merged commit bc2b02a into main Oct 8, 2025
3 checks passed
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.

2 participants