-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfilter-order-sanitizedMembers.html
75 lines (70 loc) · 1.61 KB
/
filter-order-sanitizedMembers.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html
xmlns="http://www.w3.org/1999/xhtml"
lang="ja"
xml:lang="ja"
dir="ltr"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml"
>
<head>
<title>filter-dimension</title>
</head>
<body>
<h2>filter-dimension</h2>
<script>
const sanitizedMembers = [
{
name: "firebase.event_previous_timestamp",
type: "time",
},
{
name: "firebase.event_timestamp",
type: "time",
},
{
name: "firebase.country",
type: "string",
},
{
name: "firebase.user_first_touch_timestamp",
type: "time",
},
];
const timeDimensions = [
{
dimension: {
name: "firebase.event_timestamp",
},
granularity: "hour",
},
{
dimension: {
name: "firebase.user_first_touch_timestamp",
},
},
];
// const output = [
// {
// name: "firebase.event_previous_timestamp",
// type: "time",
// },
// {
// name: "firebase.country",
//type: "string",
// },
// {
// name: "firebase.user_first_touch_timestamp",
// type: "time",
// },
// ];
const output = sanitizedMembers.filter((member) => {
const timeDimension = timeDimensions.find(
(td) => td.dimension.name === member.name
);
return !timeDimension || !timeDimension.granularity;
});
console.log(output);
</script>
</body>
</html>