(v: string | undefined, displayType: boolean = false)
| 78 | |
| 79 | //根据标识返回StorageListAll |
| 80 | function searchStorageInfo(v: string | undefined, displayType: boolean = false): StorageInfoType { |
| 81 | for (const storageItem of storageInfoList) { |
| 82 | if (!displayType) { |
| 83 | if ( |
| 84 | (storageItem.description === v || storageItem.label === v || storageItem.type === v) && |
| 85 | !storageItem.displayType |
| 86 | ) { |
| 87 | return storageItem |
| 88 | } |
| 89 | } else { |
| 90 | if ( |
| 91 | storageItem.description === v || |
| 92 | storageItem.label === v || |
| 93 | storageItem.displayType === v |
| 94 | ) { |
| 95 | return storageItem |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | return storageInfoList[0]! |
| 100 | } |
| 101 | |
| 102 | export { searchStorageInfo, updateStorageInfoList, storageInfoList } |
no outgoing calls
no test coverage detected