From 023f0540b1d29e59cc4e5b47ca04e9cda9143f4b Mon Sep 17 00:00:00 2001 From: Yulong Ruan Date: Fri, 22 Mar 2024 17:05:15 +0800 Subject: [PATCH] Added a comment to featureMatchesConfig for loop Signed-off-by: Yulong Ruan --- src/plugins/workspace/public/utils.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/workspace/public/utils.ts b/src/plugins/workspace/public/utils.ts index 444b3aadadf3..510b760b3c57 100644 --- a/src/plugins/workspace/public/utils.ts +++ b/src/plugins/workspace/public/utils.ts @@ -25,6 +25,11 @@ export const featureMatchesConfig = (featureConfigs: string[]) => ({ }) => { let matched = false; + /** + * Iterate through each feature configuration to determine if the given feature matches any of them. + * Note: The loop will not break prematurely because the order of featureConfigs array matters. + * Later configurations may override previous ones, so each configuration must be evaluated in sequence. + */ for (const featureConfig of featureConfigs) { // '*' matches any feature if (featureConfig === '*') {