@@ -12,6 +12,7 @@ import {
12
12
IDataProviderHistoricalResponse ,
13
13
IDataProviderResponse
14
14
} from '@ghostfolio/api/services/interfaces/interfaces' ;
15
+ import { REPLACE_NAME_PARTS } from '@ghostfolio/common/config' ;
15
16
import { DATE_FORMAT , parseDate } from '@ghostfolio/common/helper' ;
16
17
import {
17
18
DataProviderInfo ,
@@ -186,7 +187,7 @@ export class FinancialModelingPrepService implements DataProviderInterface {
186
187
response . isin = assetProfile . isin ;
187
188
}
188
189
189
- response . name = assetProfile . companyName ;
190
+ response . name = this . formatName ( { name : assetProfile . companyName } ) ;
190
191
191
192
if ( assetProfile . website ) {
192
193
response . url = assetProfile . website ;
@@ -398,7 +399,7 @@ export class FinancialModelingPrepService implements DataProviderInterface {
398
399
assetSubClass : undefined , // TODO
399
400
dataProviderInfo : this . getDataProviderInfo ( ) ,
400
401
dataSource : this . getName ( ) ,
401
- name : companyName
402
+ name : this . formatName ( { name : companyName } )
402
403
} ;
403
404
} ) ;
404
405
} else {
@@ -414,12 +415,12 @@ export class FinancialModelingPrepService implements DataProviderInterface {
414
415
items = result . map ( ( { currency, name, symbol } ) => {
415
416
return {
416
417
currency,
417
- name,
418
418
symbol,
419
419
assetClass : undefined , // TODO
420
420
assetSubClass : undefined , // TODO
421
421
dataProviderInfo : this . getDataProviderInfo ( ) ,
422
- dataSource : this . getName ( )
422
+ dataSource : this . getName ( ) ,
423
+ name : this . formatName ( { name } )
423
424
} ;
424
425
} ) ;
425
426
}
@@ -438,6 +439,18 @@ export class FinancialModelingPrepService implements DataProviderInterface {
438
439
return { items } ;
439
440
}
440
441
442
+ private formatName ( { name } : { name : string } ) {
443
+ if ( name ) {
444
+ for ( const part of REPLACE_NAME_PARTS ) {
445
+ name = name . replace ( part , '' ) ;
446
+ }
447
+
448
+ name = name . trim ( ) ;
449
+ }
450
+
451
+ return name ;
452
+ }
453
+
441
454
private getUrl ( { version } : { version : number } ) {
442
455
return `https://financialmodelingprep.com/api/v${ version } ` ;
443
456
}
0 commit comments