浏览代码

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]] || '';
     }
   }