Revisiontypeno test imports ittype Revision = Brand<string, "anyfs revision">;The identity of one state of an object: scheme:value. Made only by parseRevision.
The revision of an object and the cursor of a list, each a branded text made only by its parser. A revision is scheme:value: the scheme says what the value is (sha256 the digest of the bytes, etag an entity tag, git an object id, ver a version a service gave), and two revisions are equal when their texts are, so that a write which expects one can be decided by any backend.
import { parseRevision, schemeOf } from "./revision.ts";
const r = parseRevision("sha256:ab12");
r.kind === "ok" && schemeOf(r.value); // "sha256"Revisiontypeno test imports ittype Revision = Brand<string, "anyfs revision">;The identity of one state of an object: scheme:value. Made only by parseRevision.
Cursortypeno test imports ittype Cursor = Brand<string, "anyfs cursor">;Where a list resumes: opaque to the caller. Made only by parseCursor.
parseRevisionfunctionfunction parseRevision(text: string): Result<Revision, string>A revision from text, or the reason it is not one: a lower case scheme, a colon and printable ASCII with no space, at most 256 characters.
parseCursorfunctionfunction parseCursor(text: string): Result<Cursor, string>A cursor from text, or the reason it is not one: printable ASCII with no space, at most 1024 characters.
schemeOffunctionfunction schemeOf(revision: Revision): stringThe scheme of a revision: what its value is.