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' , ( ) => {
@@ -35,6 +37,17 @@ describe('custom parser', () => {
3537 } ) ;
3638 } ) ;
3739
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+
3851 describe ( 'parse example from JSDoc documentation https://jsdoc.app/' , ( ) => {
3952 // JSDoc Example from https://jsdoc.app/
4053 it ( 'parse amd-module' , async ( ) => {
You can’t perform that action at this time.
0 commit comments