mirror of
https://github.com/yamadashy/repomix.git
synced 2026-02-03 11:33:39 +01:00
- Remove unused imports across 67 files (RepomixConfigMerged, QueryCapture, etc.) - Fix unused parameters by prefixing with underscore (_context, _index, etc.) - Remove unused catch parameters using modern JavaScript syntax - Fix require-yield warnings in generator functions - Remove unused variables and interface declarations - Add oxlint configuration to ignore integration test fixtures Resolves 144 linting warnings while preserving all functionality. All 743 tests continue to pass. Code quality significantly improved.
21 lines
723 B
TypeScript
21 lines
723 B
TypeScript
/**
|
|
* Validates a GitHub repository URL or shorthand format
|
|
* TODO: Share this validation logic with repomix core (src/cli/actions/remoteAction.ts)
|
|
*/
|
|
export function isValidRemoteValue(remoteValue: string): boolean {
|
|
// Check the short form of the GitHub URL. e.g. yamadashy/repomix
|
|
const namePattern = '[a-zA-Z0-9](?:[a-zA-Z0-9._-]*[a-zA-Z0-9])?';
|
|
const shortFormRegex = new RegExp(`^${namePattern}/${namePattern}$`);
|
|
if (shortFormRegex.test(remoteValue)) {
|
|
return true;
|
|
}
|
|
|
|
// Check the direct form of the GitHub URL. e.g. https://github.com/yamadashy/repomix or https://gist.github.com/yamadashy/1234567890abcdef
|
|
try {
|
|
new URL(remoteValue);
|
|
return true;
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|