mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 09:58:04 +08:00
refactor(web): replace String.match() with RegExp.exec() for non-global regex (#32386)
This commit is contained in:
@ -7,7 +7,7 @@ import { ALL_PLANS, NUM_INFINITE } from '@/app/components/billing/config'
|
||||
* @example "50MB" -> 50, "5GB" -> 5120, "20GB" -> 20480
|
||||
*/
|
||||
export const parseVectorSpaceToMB = (vectorSpace: string): number => {
|
||||
const match = vectorSpace.match(/^(\d+)(MB|GB)$/i)
|
||||
const match = /^(\d+)(MB|GB)$/i.exec(vectorSpace)
|
||||
if (!match)
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user