UNPKG

451 BPlain TextView Raw
1const SEP = ':';
2const make = ({ plugin, resourceType }: { readonly plugin: string; readonly resourceType: string }): string =>
3 `${plugin}${SEP}${resourceType}`;
4
5const 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
16export const pluginResourceTypeUtil = {
17 extract,
18 make,
19};