MCPcopy Create free account
hub / github.com/hashintel/hash / isValidSlug

Function isValidSlug

apps/hash-api/src/analysis/shared/storage-key.ts:45–46  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

43const SLUG_PATTERN = /^[a-zA-Z0-9_][a-zA-Z0-9_.=-]{0,127}$/;
44
45export const isValidSlug = (value: unknown): value is string =>
46 typeof value === "string" && SLUG_PATTERN.test(value);
47
48/**
49 * Read a required slug argument, throwing {@link AnalysisArgError} if it is

Callers 3

assertValidSlugFunction · 0.90
requireSlugArgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected