Skip to main content
Before GitResolve fetches a single URL or opens a single file, it runs every input through a classification step. This step determines which processing pipeline to invoke — portfolio scraping, PDF parsing, direct profile resolution, or a deliberate skip — so that downstream logic always knows exactly what kind of source it is working with. Getting classification right is essential: sending a resume file path into the portfolio scraper, or treating a bare GitHub profile as a repository URL, would produce empty or incorrect results. classifyInput resolves that ambiguity with a fast, deterministic decision before any network or file I/O takes place.

InputType reference

Every input resolves to one of seven InputType values. The table below lists each value, what it represents, and a concrete example.
resume_url is defined in the InputType union but is never returned by classifyInput. A URL ending in .pdf hosted on a non-git domain resolves to 'portfolio' through the classification algorithm. The CLI assigns 'resume_url' as the sourceType after it has downloaded a remote PDF and is about to hand it off for parsing — this assignment happens outside classifyInput entirely.

Classification decision flow

classifyInput applies rules in strict order and returns as soon as a match is found. Step 7 (portfolio) acts as a catch-all for any valid URL that did not match an earlier rule — the only step that returns without a positive match is step 3, which returns unknown when the URL constructor throws.
1

Trim whitespace

The raw input string is trimmed of leading and trailing whitespace. All subsequent checks operate on this cleaned value.
2

File extension check → resume_file

If the trimmed string ends with .pdf, .doc, .docx, or .rtf (case-insensitive), the input is classified as resume_file immediately. No URL parsing is attempted.
3

URL parse attempt — failure → unknown

The string is passed to the URL constructor. If parsing throws, the input cannot be a valid web address and is classified as unknown.
classifyInput does not prepend https:// automatically. A bare hostname like github.com/janedoe fails URL parsing and returns unknown. Always pass fully-qualified URLs with a scheme.
4

LinkedIn hostname check → linkedin

If the parsed URL’s hostname contains linkedin.com, the input is classified as linkedin. Processing stops here — GitResolve does not attempt to scrape or resolve LinkedIn URLs (see LinkedIn handling below).
5

Repo URL validation → repo_url

The URL is passed to parseRepoUrl(). If it returns valid: true — meaning it has a recognised git hostname and a valid owner/repo path structure — the input is classified as repo_url.
6

Known git host with path segments → git_profile

If the hostname is github.com, www.github.com, gitlab.com, www.gitlab.com, bitbucket.org, or www.bitbucket.org, and the URL path contains at least one segment, the input is a profile page.
A bare root URL with no path segments (https://github.com) returns unknown because there is no username to extract.
7

Any other valid URL → portfolio

If the URL passed all previous checks without matching, it is classified as portfolio. This covers personal websites, project homepages, hosted slides, and any other web page that might contain git links.

What GitResolve does for each type

Classification determines which pipeline runs next:

LinkedIn: intentionally not resolved

When classifyInput returns linkedin, GitResolve records the type and moves on without issuing any request. LinkedIn’s terms of service prohibit automated scraping, and their login walls make reliable extraction impractical. If a candidate’s LinkedIn URL is the only input available, the resolver returns a result with confidence: 'none' and a warning indicating the source was skipped.
If you need to connect a LinkedIn profile to a GitHub identity, ask candidates to include their GitHub URL directly on their portfolio or resume. GitResolve will pick it up automatically during scraping or PDF parsing.

Code example

Disambiguation

How GitResolve determines which GitHub identity owns the resolved links

Result Structure

The full shape of ResolverResult and AggregatedResult