File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
packages/doxdox-parser-custom/src Expand file tree Collapse file tree 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' ;
24
35describe ( 'custom parser' , ( ) => {
46 describe ( 'parse' , ( ) => {
@@ -27,6 +29,17 @@ describe('custom parser', () => {
2729 } ) ;
2830 } ) ;
2931
32+ describe ( 'check regular expressions' , ( ) => {
33+ it ( 'jsdoc pattern is safe' , ( ) => {
34+ expect ( safe ( JSDOC_PATTERN ) ) . toBeTruthy ( ) ;
35+ } ) ;
36+ it ( 'identifier patterns are safe' , ( ) => {
37+ for ( let i = 0 ; i < IDENTIFIER_PATTERNS . length ; i += 1 ) {
38+ expect ( safe ( IDENTIFIER_PATTERNS [ i ] ) ) . toBeTruthy ( ) ;
39+ }
40+ } ) ;
41+ } ) ;
42+
3043 describe ( 'parse example from JSDoc documentation https://jsdoc.app/' , ( ) => {
3144 // JSDoc Example from https://jsdoc.app/
3245 it ( 'parse amd-module' , async ( ) => {
You can’t perform that action at this time.
0 commit comments