Skip to content

Commit

Permalink
Merge pull request #5259 from NomicFoundation/tasks-def
Browse files Browse the repository at this point in the history
Improve isValidParamNameCasing
  • Loading branch information
schaable committed May 22, 2024
2 parents c37cf0d + a69f0c4 commit 04e8150
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions v-next/core/src/internal/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ export const RESERVED_PARAMETER_NAMES = new Set([
"version",
]);

const VALID_PARAM_NAME_CASING_REGEX = /^[a-z]+(?:[a-zA-Z0-9])*$/;
const VALID_PARAM_NAME_CASING_REGEX = /^[a-z][a-zA-Z0-9]*$/;

/**
* Returns true if the given name is a valid parameter name.
*/
export function isValidParamNameCasing(name: string): boolean {
return name.match(VALID_PARAM_NAME_CASING_REGEX) !== null;
return VALID_PARAM_NAME_CASING_REGEX.test(name);
}

0 comments on commit 04e8150

Please sign in to comment.