This repository was archived by the owner on Feb 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
1
// Copyright 2021 Canva Inc. All Rights Reserved.
2
2
3
3
import * as camelcase from 'camelcase' ;
4
- import { escapeRegExp } from 'lodash' ;
4
+ import escapeRegExp = require ( 'lodash.escaperegexp' ) ;
5
5
import { OptionsV2 , parseStringPromise as xml2js } from 'xml2js' ;
6
6
import { DependencyTree , FileToDeps , Path } from '../' ;
7
7
import { FileProcessor } from '../file_processor' ;
Original file line number Diff line number Diff line change 2
2
3
3
import { messages } from 'cucumber-messages' ;
4
4
import * as gherkin from 'gherkin' ;
5
+ import escapeRegExp = require( 'lodash.escaperegexp' ) ;
5
6
import * as path from 'path' ;
6
7
import * as ts from 'typescript' ;
7
8
import { FileToDeps , Path } from '../' ;
@@ -16,8 +17,12 @@ const warn = logger.extend('warn');
16
17
17
18
const STORIES_IMPORT = 'storiesOf' ;
18
19
const STORIES_PACKAGE = '@storybook/react' ;
19
- const STORIES_FILE_RE = new RegExp ( `([^${ path . sep } ]+)\\.stories\\.tsx?$` ) ;
20
- const STEPS_FILE_RE = new RegExp ( `([^${ path . sep } ]+)\\.steps\\.ts$` ) ;
20
+ const STORIES_FILE_RE = new RegExp (
21
+ `([^${ escapeRegExp ( path . sep ) } ]+)\\.stories\\.tsx?$` ,
22
+ ) ;
23
+ const STEPS_FILE_RE = new RegExp (
24
+ `([^${ escapeRegExp ( path . sep ) } ]+)\\.steps\\.ts$` ,
25
+ ) ;
21
26
const RE_LITERAL_RE = / ^ \/ ( .+ ) \/ ( [ g i m s u y ] * ) $ / ;
22
27
const STEP_DEFININITION_FN_NAMES = [ 'When' , 'Then' , 'Given' ] ;
23
28
You can’t perform that action at this time.
0 commit comments