From 657b5d1992f68260ff750002663c93bf0ae48e0c Mon Sep 17 00:00:00 2001 From: jaclewu Date: Wed, 20 Dec 2023 14:26:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E5=8C=B9=E9=85=8D=E6=97=B6=E5=89=8D=E7=BC=80=E7=9B=B8?= =?UTF-8?q?=E5=90=8C=E6=83=85=E5=86=B5=E4=B8=8B,=E9=95=BF=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E8=A2=AB=E7=9F=AD=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E5=90=8E=E6=97=A0=E5=8C=B9=E9=85=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/wxa-plugin-replace/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/wxa-plugin-replace/index.js b/packages/wxa-plugin-replace/index.js index 9418707..27e9ead 100644 --- a/packages/wxa-plugin-replace/index.js +++ b/packages/wxa-plugin-replace/index.js @@ -38,7 +38,7 @@ module.exports = class ReplacePlugin { mapConfigsToWxa(configs) { if(configs == null) return []; - return Object.keys(configs).reduce((ret, name, idx)=>{ + return Object.keys(configs).sort((a, b) => b.length - a.length).reduce((ret, name, idx)=>{ ret.push({ regular: new RegExp(name, this.configs.flag), value: configs[name], -- Gitee