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

👌 IMPROVE: checkAllSettle extended api #3

Merged
merged 2 commits into from
Oct 1, 2024
Merged

Conversation

rphlmr
Copy link
Owner

@rphlmr rphlmr commented Oct 1, 2024

Description

The checkAllSettle tuple parameter can now take a policy with no argument directly instead of passing it into an array.

It should simplify the API.

  const snapshot = checkAllSettle([
    [guard.post.policy("is my post"), post], // Policy with argument
    ["post has comments", post.comments.length > 0], // Implicit policy with no argument
    definePolicy("post has likes", post.likes.length > 0), // Policy without argument. Can be used as is
  ]);

Copy link

github-actions bot commented Oct 1, 2024

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 100% (🎯 80%) 731 / 731
🟢 Statements 100% (🎯 80%) 731 / 731
🟢 Functions 100% (🎯 80%) 15 / 15
🟢 Branches 100% (🎯 80%) 55 / 55
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/index.ts 100% 100% 100% 100%
Generated in workflow #6 for commit 9d01480 by the Vitest Coverage Report Action

Copy link

pkg-pr-new bot commented Oct 1, 2024

Open in Stackblitz

yarn add https://pkg.pr.new/rphlmr/comply@3.tgz

commit: 9d01480

@rphlmr rphlmr merged commit bce02e3 into main Oct 1, 2024
6 checks passed
@rphlmr rphlmr deleted the check-all-settle-enhanced branch October 1, 2024 13:42
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