Skip to content
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

Add P.object, P.object.empty and P.object.exact() #234

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

Commits on Mar 31, 2024

  1. docs: add P.object on README.md

    gitsunmin authored and gvergnaud committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    e12e85c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    380d60f View commit details
    Browse the repository at this point in the history
  3. Fix multiple issues based on PR review feedback

    - Comment: Seems like chainable would be enough here, since you can't chain empty several times
    - Comment: I think we could make this more efficient by using a for in loop instead of Object.keys and breaking the loop by returning false if an object own property is encountered.
    - Comment: It should just be Chainable here as well
    - Comment: I'm not sure a new pattern type is necessary here because both patterns you added are implemented with guards
    - Comment: Could you add test covering how P.object behaves with more inputs: Functions, Primitive values, Null. It should catch all values that are assignable to the object type, and type narrowing and exhaustive should both work
    - Comment: Could you remove this diff?
    gitsunmin authored and gvergnaud committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    f32bfe5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2f49cf2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e6bf0af View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6cc4989 View commit details
    Browse the repository at this point in the history