1
- import _ , { Dictionary } from 'lodash'
1
+ import _ from 'lodash'
2
2
import { messages } from '@cucumber/messages'
3
3
import { doesHaveValue } from '../../value_checker'
4
4
5
5
export function getGherkinStepMap (
6
6
gherkinDocument : messages . IGherkinDocument
7
- ) : Dictionary < messages . GherkinDocument . Feature . IStep > {
7
+ ) : Record < string , messages . GherkinDocument . Feature . IStep > {
8
8
return _ . chain ( gherkinDocument . feature . children )
9
9
. map ( extractStepContainers )
10
10
. flatten ( )
@@ -35,7 +35,7 @@ function extractStepContainers(
35
35
36
36
export function getGherkinScenarioMap (
37
37
gherkinDocument : messages . IGherkinDocument
38
- ) : Dictionary < messages . GherkinDocument . Feature . IScenario > {
38
+ ) : Record < string , messages . GherkinDocument . Feature . IScenario > {
39
39
return _ . chain ( gherkinDocument . feature . children )
40
40
. map ( ( child : messages . GherkinDocument . Feature . IFeatureChild ) => {
41
41
if ( doesHaveValue ( child . rule ) ) {
@@ -56,7 +56,7 @@ export function getGherkinScenarioMap(
56
56
57
57
export function getGherkinExampleRuleMap (
58
58
gherkinDocument : messages . IGherkinDocument
59
- ) : Dictionary < messages . GherkinDocument . Feature . FeatureChild . IRule > {
59
+ ) : Record < string , messages . GherkinDocument . Feature . FeatureChild . IRule > {
60
60
return _ . chain ( gherkinDocument . feature . children )
61
61
. filter ( 'rule' )
62
62
. map ( 'rule' )
@@ -72,11 +72,12 @@ export function getGherkinExampleRuleMap(
72
72
73
73
export function getGherkinScenarioLocationMap (
74
74
gherkinDocument : messages . IGherkinDocument
75
- ) : Dictionary < messages . ILocation > {
76
- const locationMap : Dictionary < messages . ILocation > = { }
77
- const scenarioMap : Dictionary < messages . GherkinDocument . Feature . IScenario > = getGherkinScenarioMap (
78
- gherkinDocument
79
- )
75
+ ) : Record < string , messages . ILocation > {
76
+ const locationMap : Record < string , messages . ILocation > = { }
77
+ const scenarioMap : Record <
78
+ string ,
79
+ messages . GherkinDocument . Feature . IScenario
80
+ > = getGherkinScenarioMap ( gherkinDocument )
80
81
_ . entries < messages . GherkinDocument . Feature . IScenario > ( scenarioMap ) . forEach (
81
82
( [ id , scenario ] ) => {
82
83
locationMap [ id ] = scenario . location
0 commit comments