소스 검색

Update utils.ts

lex-xin 2 달 전
부모
커밋
c772594376
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      src/helpers/utils.ts

+ 1 - 2
src/helpers/utils.ts

@@ -490,7 +490,6 @@ export const stackInstruments: any = {
 export const getInstrumentName = (instruments: any, instrumentName: string) => {
   const _instrumentName = instrumentName
     .replace(/ /g, '')
-    .replace(/\d+|\d+/g, '')
     .trim()
     .toLocaleLowerCase();
   const _instrument = Object.keys(instruments);
@@ -502,7 +501,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]] || '';
     }
   }