@@ -13,17 +13,17 @@ export default class TypeScriptHelpers {
1313 /**
1414 * Start sequence is '/**'.
1515 */
16- public static jsDocStartRegEx : RegExp = / ^ \s * \/ \* \* \s ? / g;
16+ public static jsdocStartRegEx : RegExp = / ^ \s * \/ \* \* \s ? / g;
1717
1818 /**
1919 * End sequence is '*\/'.
2020 */
21- public static jsDocEndRegEx : RegExp = / \s * \* \/ \s * $ / g;
21+ public static jsdocEndRegEx : RegExp = / \s * \* \/ \s * $ / g;
2222
2323 /**
2424 * Intermediate lines of JSDoc comment character.
2525 */
26- public static jsDocIntermediateRegEx : RegExp = / ^ \s * [ * ] \s ? / g;
26+ public static jsdocIntermediateRegEx : RegExp = / ^ \s * [ * ] \s ? / g;
2727
2828 /**
2929 * Returns the Symbol for the provided Declaration. This is a workaround for a missing
@@ -59,34 +59,34 @@ export default class TypeScriptHelpers {
5959 * Example:
6060 * "This \n is \n a comment" from "\/** This\r\n* is\r\n* a comment *\/
6161 */
62- public static getJsDocComments ( node : ts . Node , errorLogger : ( message : string ) => void ) : string {
63- let jsDoc : string = '' ;
62+ public static getJsdocComments ( node : ts . Node , errorLogger : ( message : string ) => void ) : string {
63+ let jsdoc : string = '' ;
6464 // tslint:disable-next-line:no-any
65- const nodeJsDocObjects : any = ( node as any ) . jsDoc ;
66- if ( nodeJsDocObjects && nodeJsDocObjects . length > 0 ) {
65+ const nodeJsdocObjects : any = ( node as any ) . jsDoc ;
66+ if ( nodeJsdocObjects && nodeJsdocObjects . length > 0 ) {
6767 // Use the JSDoc closest to the declaration
68- const lastJsDocIndex : number = nodeJsDocObjects . length - 1 ;
69- const jsDocFullText : string = nodeJsDocObjects [ lastJsDocIndex ] . getText ( ) ;
70- const jsDocLines : string [ ] = jsDocFullText . split ( TypeScriptHelpers . newLineRegEx ) ;
71- const jsDocStartSeqExists : boolean = TypeScriptHelpers . jsDocStartRegEx . test ( jsDocLines [ 0 ] . toString ( ) ) ;
68+ const lastJsdocIndex : number = nodeJsdocObjects . length - 1 ;
69+ const jsdocFullText : string = nodeJsdocObjects [ lastJsdocIndex ] . getText ( ) ;
70+ const jsdocLines : string [ ] = jsdocFullText . split ( TypeScriptHelpers . newLineRegEx ) ;
71+ const jsdocStartSeqExists : boolean = TypeScriptHelpers . jsdocStartRegEx . test ( jsdocLines [ 0 ] . toString ( ) ) ;
7272
7373 // Report error for each missing sequence seperately
74- if ( ! jsDocStartSeqExists ) {
75- errorLogger ( 'JsDoc comment must begin with a \"/**\" sequence.' ) ;
74+ if ( ! jsdocStartSeqExists ) {
75+ errorLogger ( 'Jsdoc comment must begin with a \"/**\" sequence.' ) ;
7676 return '' ;
7777 }
78- const jsDocEndSeqExists : boolean = TypeScriptHelpers . jsDocEndRegEx . test (
79- jsDocLines [ jsDocLines . length - 1 ] . toString ( )
78+ const jsdocEndSeqExists : boolean = TypeScriptHelpers . jsdocEndRegEx . test (
79+ jsdocLines [ jsdocLines . length - 1 ] . toString ( )
8080 ) ;
81- if ( ! jsDocEndSeqExists ) {
82- errorLogger ( 'JsDoc comment must end with a \"*/\" sequence.' ) ;
81+ if ( ! jsdocEndSeqExists ) {
82+ errorLogger ( 'Jsdoc comment must end with a \"*/\" sequence.' ) ;
8383 return '' ;
8484 }
8585
86- jsDoc = TypeScriptHelpers . removeJsDocSequences ( jsDocLines ) ;
86+ jsdoc = TypeScriptHelpers . removeJsdocSequences ( jsdocLines ) ;
8787 }
8888
89- return jsDoc ;
89+ return jsdoc ;
9090 }
9191
9292 /**
@@ -95,15 +95,15 @@ export default class TypeScriptHelpers {
9595 * Example:
9696 * ["\/**", "*This \n", "*is \n", "*a comment", "*\/"] to "This \n is \n a comment"
9797 */
98- public static removeJsDocSequences ( textLines : string [ ] ) : string {
98+ public static removeJsdocSequences ( textLines : string [ ] ) : string {
9999 // Remove '/**'
100- textLines [ 0 ] = textLines [ 0 ] . replace ( TypeScriptHelpers . jsDocStartRegEx , '' ) ;
100+ textLines [ 0 ] = textLines [ 0 ] . replace ( TypeScriptHelpers . jsdocStartRegEx , '' ) ;
101101 if ( textLines [ 0 ] === '' ) {
102102 textLines . shift ( ) ;
103103 }
104104 // Remove '*/'
105105 textLines [ textLines . length - 1 ] = textLines [ textLines . length - 1 ] . replace (
106- TypeScriptHelpers . jsDocEndRegEx ,
106+ TypeScriptHelpers . jsdocEndRegEx ,
107107 '' ) ;
108108 if ( textLines [ textLines . length - 1 ] === '' ) {
109109 textLines . pop ( ) ;
@@ -112,7 +112,7 @@ export default class TypeScriptHelpers {
112112 // Remove the leading '*' from any intermediate lines
113113 if ( textLines . length > 0 ) {
114114 for ( let i : number = 0 ; i < textLines . length ; i ++ ) {
115- textLines [ i ] = textLines [ i ] . replace ( TypeScriptHelpers . jsDocIntermediateRegEx , '' ) ;
115+ textLines [ i ] = textLines [ i ] . replace ( TypeScriptHelpers . jsdocIntermediateRegEx , '' ) ;
116116 }
117117 }
118118
0 commit comments