Skip to content

Commit 1bff567

Browse files
committed
fix:improve privacy-helper
1 parent 63d80d6 commit 1bff567

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

packages/plugins/rum/src/built/privacy-helpers.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ export function $(newValues: string[] | TemplateStringsArray) {
1818
return newValues;
1919
}
2020

21-
newValues.forEach((value) => {
22-
if (Array.isArray(value)) {
23-
value.forEach((raw) => {
24-
globalAny.$DD_ALLOW.add(raw);
25-
});
26-
} else {
21+
newValues
22+
.flatMap((value) => {
23+
if (Array.isArray(value)) {
24+
return value;
25+
}
26+
return value;
27+
})
28+
.forEach((value) => {
2729
globalAny.$DD_ALLOW.add(value);
28-
}
29-
});
30+
});
31+
3032
if (globalAny.$DD_ALLOW.size !== initialSize) {
3133
if (globalAny.$DD_ALLOW_OBSERVERS) {
3234
globalAny.$DD_ALLOW_OBSERVERS.forEach((cb: () => void) => cb());

0 commit comments

Comments
 (0)