Skip to content

Commit 99cf694

Browse files
authored
fix: ParameterType constructor (#178)
* fix: ParameterType constructor `transform`, `useForSnippets` and `preferForRegexpMatch` can all be optional. * chore: update changelog I did this manually
1 parent e5d1db4 commit 99cf694

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
9+
### Fixed
10+
- [JavaScript] The `ParameterType` constructor's `transform`, `useForSnippets` and `preferForRegexpMatch` should be optional. ([#178](https://github.com/cucumber/cucumber-expressions/pull/178))
911

1012
## [16.0.0] - 2022-06-12
1113
### Changed

javascript/src/ParameterType.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ export default class ParameterType<T> {
5454
public readonly name: string | undefined,
5555
regexps: RegExps,
5656
public readonly type: Constructor<T> | Factory<T> | null,
57-
transform: (...match: string[]) => T | PromiseLike<T>,
58-
public readonly useForSnippets: boolean,
59-
public readonly preferForRegexpMatch: boolean
57+
transform?: (...match: string[]) => T | PromiseLike<T>,
58+
public readonly useForSnippets?: boolean,
59+
public readonly preferForRegexpMatch?: boolean
6060
) {
6161
if (transform === undefined) {
6262
transform = (s) => s as unknown as T

0 commit comments

Comments
 (0)