1 | const SEP = ':';
|
2 | const make = ({ plugin, resourceType }: { readonly plugin: string; readonly resourceType: string }): string =>
|
3 | `${plugin}${SEP}${resourceType}`;
|
4 |
|
5 | const extract = (
|
6 | pluginResourceType: string,
|
7 | ): {
|
8 | readonly plugin: string;
|
9 | readonly resourceType: string;
|
10 | } => {
|
11 | const [plugin, resourceType] = pluginResourceType.split(SEP);
|
12 |
|
13 | return { plugin, resourceType };
|
14 | };
|
15 |
|
16 | export const pluginResourceTypeUtil = {
|
17 | extract,
|
18 | make,
|
19 | };
|