@acm-uiuc/js-shared 3.2.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/orgs.d.ts +175 -7
- package/dist/orgs.js +11 -11
- package/package.json +1 -1
package/dist/orgs.d.ts
CHANGED
|
@@ -10,14 +10,182 @@ export type Organization = {
|
|
|
10
10
|
shortcode: string;
|
|
11
11
|
color: string;
|
|
12
12
|
};
|
|
13
|
-
export declare const Organizations:
|
|
14
|
-
|
|
13
|
+
export declare const Organizations: {
|
|
14
|
+
readonly A01: {
|
|
15
|
+
readonly name: "ACM";
|
|
16
|
+
readonly type: OrgType.MAIN;
|
|
17
|
+
readonly shortcode: "acm";
|
|
18
|
+
readonly color: "#4577f8";
|
|
19
|
+
};
|
|
20
|
+
readonly S01: {
|
|
21
|
+
readonly name: "SIGPwny";
|
|
22
|
+
readonly type: OrgType.SIG;
|
|
23
|
+
readonly shortcode: "sigpwny";
|
|
24
|
+
readonly color: "#33cc55";
|
|
25
|
+
};
|
|
26
|
+
readonly S02: {
|
|
27
|
+
readonly name: "SIGCHI";
|
|
28
|
+
readonly type: OrgType.SIG;
|
|
29
|
+
readonly shortcode: "sigchi";
|
|
30
|
+
readonly color: "#EEAE48";
|
|
31
|
+
};
|
|
32
|
+
readonly S03: {
|
|
33
|
+
readonly name: "GameBuilders";
|
|
34
|
+
readonly type: OrgType.SIG;
|
|
35
|
+
readonly shortcode: "gamebuilders";
|
|
36
|
+
readonly color: "#29386D";
|
|
37
|
+
};
|
|
38
|
+
readonly S04: {
|
|
39
|
+
readonly name: "SIGAIDA";
|
|
40
|
+
readonly type: OrgType.SIG;
|
|
41
|
+
readonly shortcode: "sigaida";
|
|
42
|
+
readonly color: "#BFDDFC";
|
|
43
|
+
};
|
|
44
|
+
readonly S05: {
|
|
45
|
+
readonly name: "SIGGRAPH";
|
|
46
|
+
readonly type: OrgType.SIG;
|
|
47
|
+
readonly shortcode: "siggraph";
|
|
48
|
+
readonly color: "#7896A7";
|
|
49
|
+
};
|
|
50
|
+
readonly S06: {
|
|
51
|
+
readonly name: "ICPC";
|
|
52
|
+
readonly type: OrgType.SIG;
|
|
53
|
+
readonly shortcode: "icpc";
|
|
54
|
+
readonly color: "#AF2A23";
|
|
55
|
+
};
|
|
56
|
+
readonly S07: {
|
|
57
|
+
readonly name: "SIGMobile";
|
|
58
|
+
readonly type: OrgType.SIG;
|
|
59
|
+
readonly shortcode: "sigmobile";
|
|
60
|
+
readonly color: "#0C7BBD";
|
|
61
|
+
};
|
|
62
|
+
readonly S08: {
|
|
63
|
+
readonly name: "SIGMusic";
|
|
64
|
+
readonly type: OrgType.SIG;
|
|
65
|
+
readonly shortcode: "sigmusic";
|
|
66
|
+
readonly color: "#F4DCA3";
|
|
67
|
+
};
|
|
68
|
+
readonly S09: {
|
|
69
|
+
readonly name: "GLUG";
|
|
70
|
+
readonly type: OrgType.SIG;
|
|
71
|
+
readonly shortcode: "glug";
|
|
72
|
+
readonly color: "#E94A27";
|
|
73
|
+
};
|
|
74
|
+
readonly S10: {
|
|
75
|
+
readonly name: "SIGNLL";
|
|
76
|
+
readonly type: OrgType.SIG;
|
|
77
|
+
readonly shortcode: "signll";
|
|
78
|
+
readonly color: "#F59A23";
|
|
79
|
+
};
|
|
80
|
+
readonly S11: {
|
|
81
|
+
readonly name: "SIGma";
|
|
82
|
+
readonly type: OrgType.SIG;
|
|
83
|
+
readonly shortcode: "sigma";
|
|
84
|
+
readonly color: "#4B65F2";
|
|
85
|
+
};
|
|
86
|
+
readonly S12: {
|
|
87
|
+
readonly name: "SIGQuantum";
|
|
88
|
+
readonly type: OrgType.SIG;
|
|
89
|
+
readonly shortcode: "sigquantum";
|
|
90
|
+
readonly color: "#233643";
|
|
91
|
+
};
|
|
92
|
+
readonly S13: {
|
|
93
|
+
readonly name: "SIGecom";
|
|
94
|
+
readonly type: OrgType.SIG;
|
|
95
|
+
readonly shortcode: "sigecom";
|
|
96
|
+
readonly color: "#00759A";
|
|
97
|
+
};
|
|
98
|
+
readonly S14: {
|
|
99
|
+
readonly name: "SIGPLAN";
|
|
100
|
+
readonly type: OrgType.SIG;
|
|
101
|
+
readonly shortcode: "sigplan";
|
|
102
|
+
readonly color: "#4577f8";
|
|
103
|
+
};
|
|
104
|
+
readonly S15: {
|
|
105
|
+
readonly name: "SIGPolicy";
|
|
106
|
+
readonly type: OrgType.SIG;
|
|
107
|
+
readonly shortcode: "sigpolicy";
|
|
108
|
+
readonly color: "#292929";
|
|
109
|
+
};
|
|
110
|
+
readonly S16: {
|
|
111
|
+
readonly name: "SIGARCH";
|
|
112
|
+
readonly type: OrgType.SIG;
|
|
113
|
+
readonly shortcode: "sigarch";
|
|
114
|
+
readonly color: "#155CD0";
|
|
115
|
+
};
|
|
116
|
+
readonly S17: {
|
|
117
|
+
readonly name: "SIGRobotics";
|
|
118
|
+
readonly type: OrgType.SIG;
|
|
119
|
+
readonly shortcode: "sigrobotics";
|
|
120
|
+
readonly color: "#B0B0B0";
|
|
121
|
+
};
|
|
122
|
+
readonly S18: {
|
|
123
|
+
readonly name: "SIGtricity";
|
|
124
|
+
readonly type: OrgType.SIG;
|
|
125
|
+
readonly shortcode: "sigtricity";
|
|
126
|
+
readonly color: "#4577f8";
|
|
127
|
+
};
|
|
128
|
+
readonly C01: {
|
|
129
|
+
readonly name: "Infrastructure Committee";
|
|
130
|
+
readonly type: OrgType.COMMITTEE;
|
|
131
|
+
readonly shortcode: "infra";
|
|
132
|
+
readonly color: "#4577f8";
|
|
133
|
+
};
|
|
134
|
+
readonly C02: {
|
|
135
|
+
readonly name: "Social Committee";
|
|
136
|
+
readonly type: OrgType.COMMITTEE;
|
|
137
|
+
readonly shortcode: "social";
|
|
138
|
+
readonly color: "#4577f8";
|
|
139
|
+
};
|
|
140
|
+
readonly C03: {
|
|
141
|
+
readonly name: "Mentorship Committee";
|
|
142
|
+
readonly type: OrgType.COMMITTEE;
|
|
143
|
+
readonly shortcode: "mentorship";
|
|
144
|
+
readonly color: "#4577f8";
|
|
145
|
+
};
|
|
146
|
+
readonly C04: {
|
|
147
|
+
readonly name: "Academic Committee";
|
|
148
|
+
readonly type: OrgType.COMMITTEE;
|
|
149
|
+
readonly shortcode: "academic";
|
|
150
|
+
readonly color: "#4577f8";
|
|
151
|
+
};
|
|
152
|
+
readonly C05: {
|
|
153
|
+
readonly name: "Corporate Committee";
|
|
154
|
+
readonly type: OrgType.COMMITTEE;
|
|
155
|
+
readonly shortcode: "corporate";
|
|
156
|
+
readonly color: "#4577f8";
|
|
157
|
+
};
|
|
158
|
+
readonly C06: {
|
|
159
|
+
readonly name: "Marketing Committee";
|
|
160
|
+
readonly type: OrgType.COMMITTEE;
|
|
161
|
+
readonly shortcode: "marketing";
|
|
162
|
+
readonly color: "#4577f8";
|
|
163
|
+
};
|
|
164
|
+
readonly C07: {
|
|
165
|
+
readonly name: "Reflections | Projections";
|
|
166
|
+
readonly type: OrgType.COMMITTEE;
|
|
167
|
+
readonly shortcode: "reflproj";
|
|
168
|
+
readonly color: "#4577f8";
|
|
169
|
+
};
|
|
170
|
+
readonly C08: {
|
|
171
|
+
readonly name: "HackIllinois";
|
|
172
|
+
readonly type: OrgType.COMMITTEE;
|
|
173
|
+
readonly shortcode: "hackillinois";
|
|
174
|
+
readonly color: "#4577f8";
|
|
175
|
+
};
|
|
176
|
+
};
|
|
15
177
|
export type OrganizationId = keyof typeof Organizations;
|
|
16
|
-
export type OrganizationName =
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
178
|
+
export type OrganizationName = (typeof Organizations)[OrganizationId]["name"];
|
|
179
|
+
export type OrganizationsByNameType = {
|
|
180
|
+
[K in OrganizationId as (typeof Organizations)[K]["name"]]: K;
|
|
181
|
+
};
|
|
182
|
+
export declare const OrganizationsByName: OrganizationsByNameType;
|
|
183
|
+
export declare function getOrgIdByName<N extends OrganizationName>(name: N): OrganizationsByNameType[N];
|
|
184
|
+
export declare function getOrgByName<N extends OrganizationName>(name: N): (typeof Organizations)[OrganizationsByNameType[N]] & {
|
|
185
|
+
id: OrganizationsByNameType[N];
|
|
186
|
+
};
|
|
187
|
+
export declare function isValidOrgName(name: string): name is OrganizationName;
|
|
21
188
|
export declare function getOrgsByType(type: OrgType): Array<Organization & {
|
|
22
189
|
id: OrganizationId;
|
|
23
190
|
}>;
|
|
191
|
+
export declare const AllOrganizationNameList: OrganizationName[];
|
package/dist/orgs.js
CHANGED
|
@@ -34,23 +34,23 @@ export const Organizations = {
|
|
|
34
34
|
"C07": { name: "Reflections | Projections", type: OrgType.COMMITTEE, shortcode: "reflproj", color: "#4577f8" },
|
|
35
35
|
"C08": { name: "HackIllinois", type: OrgType.COMMITTEE, shortcode: "hackillinois", color: "#4577f8" },
|
|
36
36
|
};
|
|
37
|
-
export const
|
|
38
|
-
//
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
acc[org.name] = id;
|
|
44
|
-
return acc;
|
|
45
|
-
}, {});
|
|
37
|
+
export const OrganizationsByName = Object.fromEntries(Object.entries(Organizations).map(([id, org]) => [org.name, id]));
|
|
38
|
+
// Helper to get ID from name (typed return)
|
|
39
|
+
export function getOrgIdByName(name) {
|
|
40
|
+
return OrganizationsByName[name];
|
|
41
|
+
}
|
|
42
|
+
// Helper to get org by name (typed return)
|
|
46
43
|
export function getOrgByName(name) {
|
|
47
44
|
const id = OrganizationsByName[name];
|
|
48
|
-
if (!id)
|
|
49
|
-
return undefined;
|
|
50
45
|
return { ...Organizations[id], id };
|
|
51
46
|
}
|
|
47
|
+
// For cases where you have an unknown string and need to check
|
|
48
|
+
export function isValidOrgName(name) {
|
|
49
|
+
return name in OrganizationsByName;
|
|
50
|
+
}
|
|
52
51
|
export function getOrgsByType(type) {
|
|
53
52
|
return Object.entries(Organizations)
|
|
54
53
|
.filter(([_, org]) => org.type === type)
|
|
55
54
|
.map(([id, org]) => ({ ...org, id }));
|
|
56
55
|
}
|
|
56
|
+
export const AllOrganizationNameList = Object.values(Organizations).map(x => x.name);
|