File tree 1 file changed +14
-1
lines changed
packages/doxdox-parser-custom/src
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
- import parse from './index' ;
1
+ import safe from 'safe-regex' ;
2
+
3
+ import parse , { JSDOC_PATTERN , IDENTIFIER_PATTERNS } from './index' ;
2
4
3
5
describe ( 'custom parser' , ( ) => {
4
6
describe ( 'parse' , ( ) => {
@@ -35,6 +37,17 @@ describe('custom parser', () => {
35
37
} ) ;
36
38
} ) ;
37
39
40
+ describe ( 'check regular expressions' , ( ) => {
41
+ it ( 'jsdoc pattern is safe' , ( ) => {
42
+ expect ( safe ( JSDOC_PATTERN ) ) . toBeTruthy ( ) ;
43
+ } ) ;
44
+ it ( 'identifier patterns are safe' , ( ) => {
45
+ for ( let i = 0 ; i < IDENTIFIER_PATTERNS . length ; i += 1 ) {
46
+ expect ( safe ( IDENTIFIER_PATTERNS [ i ] ) ) . toBeTruthy ( ) ;
47
+ }
48
+ } ) ;
49
+ } ) ;
50
+
38
51
describe ( 'parse example from JSDoc documentation https://jsdoc.app/' , ( ) => {
39
52
// JSDoc Example from https://jsdoc.app/
40
53
it ( 'parse amd-module' , async ( ) => {
You can’t perform that action at this time.
0 commit comments