Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds explicit TypeScript typings to the expect helper and updates the package version along with dependency bumps.
- Annotated
expectfunction parameters and return type - Changed
RequiredParamErrorto useparaminstead ofvalue - Bumped package version and updated dependency versions
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/expect.ts | Added string types to expect signature and fixed error constructor arg |
| package.json | Updated version to 1.1.9 and bumped several dependencies/devDependencies |
| import { validators } from './validators' | ||
|
|
||
| export function expect(value, type) { | ||
| export function expect(value: string, type: string): void { |
There was a problem hiding this comment.
Typing type as a plain string loses safety over valid validator keys. Consider using type: keyof typeof validators to restrict to known validator names.
Suggested change
| export function expect(value: string, type: string): void { | |
| export function expect(value: string, type: keyof typeof validators): void { |
There was a problem hiding this comment.
Pull Request Overview
This PR adds explicit TypeScript annotations to the expect helper, refines the error thrown for missing parameters, and updates package and dev-dependency versions.
- Add
stringtype annotations and a return type toexpect() - Improve
RequiredParamErrorto reference the parameter name - Bump package version and dependency versions
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/expect.ts | Typed the expect parameters and return type; updated error to use param instead of the missing value |
| package.json | Version bumped to 1.1.10; updated @actions/github, ESLint, and TypeScript |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.