2022-03-03 09:35:26 +00:00
|
|
|
import { regEx } from '../../../util/regex';
|
2022-08-11 19:07:54 +00:00
|
|
|
import type { ConanPackage } from './types';
|
2022-02-11 05:15:13 +00:00
|
|
|
|
|
|
|
export const defaultRegistryUrl = 'https://center.conan.io/';
|
|
|
|
|
|
|
|
export const datasource = 'conan';
|
|
|
|
|
|
|
|
export const conanDatasourceRegex = regEx(
|
2023-11-07 15:50:29 +00:00
|
|
|
/(?<name>[a-z\-_0-9]+)\/(?<version>[^@/\n]+)(?<userChannel>@\S+\/\S+)/gim,
|
2022-02-11 05:15:13 +00:00
|
|
|
);
|
2022-08-11 19:07:54 +00:00
|
|
|
|
|
|
|
export function getConanPackage(packageName: string): ConanPackage {
|
2023-02-21 05:54:16 +00:00
|
|
|
const conanName = packageName.split('/')[0];
|
2022-08-11 19:07:54 +00:00
|
|
|
const userAndChannel = packageName.split('@')[1];
|
2023-02-21 05:54:16 +00:00
|
|
|
return { conanName, userAndChannel };
|
2022-08-11 19:07:54 +00:00
|
|
|
}
|