|
@@ -214,11 +214,7 @@
|
|
|
* @returns
|
|
|
*/
|
|
|
export const getInstrumentName = (instruments: any, instrumentName: string) => {
|
|
|
- const _instrumentName = instrumentName
|
|
|
- .replace(/ /g, "")
|
|
|
- .replace(/\d+|\d+/g, "")
|
|
|
- .trim()
|
|
|
- .toLocaleLowerCase()
|
|
|
+ const _instrumentName = instrumentName.replace(/ /g, "").trim().toLocaleLowerCase()
|
|
|
const _instrument = Object.keys(instruments)
|
|
|
for (let i = 0; i < _instrument.length; i++) {
|
|
|
const _name = _instrument[i].replace(/ /g, "").toLocaleLowerCase()
|
|
@@ -228,7 +224,7 @@ export const getInstrumentName = (instruments: any, instrumentName: string) => {
|
|
|
}
|
|
|
for (let i = 0; i < _instrument.length; i++) {
|
|
|
const _name = _instrument[i].replace(/ /g, "").toLocaleLowerCase()
|
|
|
- if (_name.includes(_instrumentName)) {
|
|
|
+ if (_instrumentName.includes(_name)) {
|
|
|
return instruments[_instrument[i]] || ""
|
|
|
}
|
|
|
}
|