@@ -98,14 +98,14 @@ export class OrgCheckDataFactory2 {
98
98
export class OrgCheckDataFactory {
99
99
100
100
#allValidations;
101
- #needDepencencies ;
101
+ #needDependencies ;
102
102
#instances;
103
103
104
104
constructor ( sfdcManager ) {
105
105
106
106
const currentApiVersion = sfdcManager . getApiVersion ( ) ;
107
107
108
- this . #allValidations = [
108
+ this . #allValidations = [ // START:ALL_VALIDATIONS
109
109
{
110
110
description : 'Not referenced anywhere' ,
111
111
formula : ( d ) => IS_EMPTY ( d . dependencies ?. referenced ) ,
@@ -359,7 +359,8 @@ export class OrgCheckDataFactory {
359
359
badField : 'usedPercentage' ,
360
360
applicable : [ SFDC_Limit ]
361
361
}
362
- ] . map ( ( v , i ) => {
362
+ ] // END:ALL_VALIDATIONS
363
+ . map ( ( v , i ) => {
363
364
// check description
364
365
if ( v . description === undefined || typeof v . description !== 'string' ) {
365
366
throw new TypeError ( `The ${ i } th Validation Rule should have a 'description' property of type 'string'.` ) ;
@@ -383,16 +384,16 @@ export class OrgCheckDataFactory {
383
384
} ) ;
384
385
Object . freeze ( this . #allValidations) ;
385
386
386
- this . #needDepencencies = [
387
+ this . #needDependencies = [ // START:ALL_NEED_DEPENDENCIES
387
388
SFDC_ApexClass , SFDC_ApexTrigger , SFDC_Field , SFDC_CustomLabel , SFDC_Flow ,
388
389
SFDC_LightningAuraComponent , SFDC_LightningPage , SFDC_LightningWebComponent ,
389
390
SFDC_VisualForceComponent , SFDC_VisualForcePage
390
- ] ;
391
+ ] ; // END:ALL_NEED_DEPENDENCIES
391
392
// check if '#needDepencencies' array contains only OrgCheckData instances
392
- if ( this . #needDepencencies === undefined || Array . isArray ( this . #needDepencencies ) === false || this . #needDepencencies . every ( ( dc ) => IS_CLASS_EXTENDS ( dc , OrgCheckData ) === false ) ) {
393
+ if ( this . #needDependencies === undefined || Array . isArray ( this . #needDependencies ) === false || this . #needDependencies . every ( ( dc ) => IS_CLASS_EXTENDS ( dc , OrgCheckData ) === false ) ) {
393
394
throw new TypeError ( `The list of classes that needs Dependencies must be of type 'array' with only OrgCheckData items.` ) ;
394
395
}
395
- Object . freeze ( this . #needDepencencies ) ;
396
+ Object . freeze ( this . #needDependencies ) ;
396
397
397
398
this . #instances = new Map ( ) ;
398
399
}
@@ -413,7 +414,7 @@ export class OrgCheckDataFactory {
413
414
this . #instances. set ( dataClass , new OrgCheckDataFactory2 (
414
415
dataClass ,
415
416
isDataClassExtendsData ? this . #allValidations. filter ( v => v . applicable . includes ( dataClass ) ) : [ ] ,
416
- isDataClassExtendsData ? this . #needDepencencies . includes ( dataClass ) : [ ]
417
+ isDataClassExtendsData ? this . #needDependencies . includes ( dataClass ) : [ ]
417
418
) ) ;
418
419
}
419
420
// Return the instance
0 commit comments