Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t.sh
25 linesCodeBlameRaw

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Git storage hardened, pages in tens of milliseconds, honest security alerts, and costs reconciled daily1import type { AccountEmail } from "@g1t/contracts";
2
3/** The fields to send again once the person has confirmed their password. */
4export function pendingFields(form: FormData): Record<string, string> {
5 const fields: Record<string, string> = {};
6 for (const [name, value] of form.entries()) {
7 if (name !== "intent" && name !== "password" && typeof value === "string") fields[name] = value;
8 }
9 return fields;
10}
11
12/** What can be done to one address, by the same rules identity applies. */
13export function addressActions(email: AccountEmail, all: AccountEmail[]): { makePrimary: boolean; remove: boolean; resend: boolean } {
14 const confirmed = all.filter((other) => other.verified).length;
15 return {
16 makePrimary: email.verified && !email.primary,
17 remove: !email.primary && !(email.verified && confirmed <= 1),
18 resend: !email.verified,
19 };
20}
21
22/** The addresses that can be the backup: confirmed, and not the primary. */
23export function backupChoices(all: AccountEmail[]): AccountEmail[] {
24 return all.filter((email) => email.verified && !email.primary);
25}

This file's history is long; its oldest lines are credited to the oldest commit read.