Results for “require”
Small, practical examples. Search by task or narrow things down below.
Handle a result with a discriminated union
Separate success data from an error message.
discriminated union✓ Tested
Handle a terminating error
Catch conversion failures and produce a clear fallback.
try catch✓ Tested
Handle an expected command failure
Branch on a command’s exit code without aborting the script.
exit status✓ Tested
Handle an expected terminating error
PowerShell: Handle an expected terminating error using PowerShell 7.
PowerShell✓ Tested
Handle three possible outcomes
TypeScript: Check high, normal and low values with an ordered conditional chain.
TypeScript✓ Tested
Identify a commit exactly at a release tag
Git: Describe with exact-match refuses to invent a label for a later commit.
Git✓ Tested
Identify the current practice branch
Git: Identify the current practice branch inside the disposable repository created by the input setup.
Git✓ Tested
Identify whether a name resolves to a builtin
Bash Scripts: type -t reports the command kind without printing a machine-specific path.
Bash Scripts✓ Tested
Ignore a disposable generated file
Git: Ignore a disposable generated file inside the disposable repository created by the input setup.
Git✓ Tested
Ignore a personal scratch file without changing shared rules
Git: The repository-local exclude file applies only to this checkout.
Git✓ Tested
Ignore generated files
Exclude build output from untracked-file listings.
gitignore✓ Tested
Include every row tied for the highest score
SQL Server: Compare with MAX rather than limiting to an arbitrary number of rows.
SQL Server✓ Tested