export function parseType(v) {
    var _a;
    const TYPE_REG = /^([a-zA-Z0-9_\d]+\/[a-zA-Z0-9_\d]+)\/([a-zA-Z0-9_\d]+)$/;
    function isValidType(v) {
        return TYPE_REG.test(v);
    }
    if (!isValidType(v)) {
        throw new Error(`Invalid type string: "${v}"`);
    }
    const [, version, name] = (_a = v.match(TYPE_REG)) !== null && _a !== void 0 ? _a : [];
    return {
        version,
        name,
    };
}
//# sourceMappingURL=parseType.js.map