Skip to content

export ConditionalSimplify and ConditionalSimplifyDeep #1094

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

romanywu
Copy link

closed #1005

@Emiyaaaaa Emiyaaaaa requested a review from Copilot March 31, 2025 03:28
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 pull request exports the ConditionalSimplify and ConditionalSimplifyDeep types and updates the tests and documentation accordingly.

  • Removed deep simplification tests from conditional-simplify.ts to separate concerns.
  • Added full test coverage for ConditionalSimplifyDeep in a dedicated file.
  • Updated readme.md to include entries for the newly exported types.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

File Description
test-d/conditional-simplify.ts Removed deep tests and adjusted the import to use the new index.
test-d/conditional-simplify-deep.ts Added comprehensive tests for ConditionalSimplifyDeep.
readme.md Updated documentation to include the new exports.

// Should simplify interface deeply.
type SomeNode = {
parent: PositionAndSizeIntersection;
childs: Array<{parent: PositionAndSizeIntersection}>;
Copy link
Preview

Copilot AI Mar 31, 2025

Choose a reason for hiding this comment

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

Consider renaming 'childs' to 'children' for correct plural form.

Copilot uses AI. Check for mistakes.

@sindresorhus
Copy link
Owner

There is never any need to open multiple pull requests. If you made a mistake, you can simply force push to the same branch. Multiple closed pull requests adds needless noise to the our notifications.

@@ -0,0 +1,62 @@
/**
Recursively simplifies a type while including and/or excluding certain types from being simplified.
Copy link
Owner

Choose a reason for hiding this comment

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

Please preserve the code example like it was originally, this includes empty lines.

Copy link
Owner

Choose a reason for hiding this comment

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

@romanywu I was talking in general, not just this example. All the code.

@romanywu romanywu requested a review from sindresorhus April 21, 2025 01:35

@example
```ts
import type {ConditionalSimplifyDeep} from 'type-fest';
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
import type {ConditionalSimplifyDeep} from 'type-fest';
import type {ConditionalSimplifyDeep} from 'type-fest';

Copy link
Owner

Choose a reason for hiding this comment

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

Etc etc.

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.

Expose ConditionalSimplify and ConditionalSimplifyDeep
3 participants