Slugs for Scala 3
Find a file
Pat Garrity d2ceadc746
All checks were successful
/ Build and Release Library (push) Successful in 1m9s
(patch) updating builds, pre-commit (#3)
Reviewed-on: #3
2024-05-02 23:12:48 +00:00
.forgejo/workflows (patch) updating builds, pre-commit (#3) 2024-05-02 23:12:48 +00:00
project (patch) Scala Version, Docs, Builds (#2) 2024-04-15 02:06:45 +00:00
src (patch) Pre-commit and builds 2024-03-24 04:02:38 +00:00
.gitignore gs-slug: Initial commit with a complete implementation. 2024-03-23 22:46:21 -05:00
.pre-commit-config.yaml (patch) updating builds, pre-commit (#3) 2024-05-02 23:12:48 +00:00
.scalafmt.conf (patch) updating builds, pre-commit (#3) 2024-05-02 23:12:48 +00:00
build.sbt (patch) Scala Version, Docs, Builds (#2) 2024-04-15 02:06:45 +00:00
LICENSE gs-slug: Initial commit with a complete implementation. 2024-03-23 22:46:21 -05:00
README.md (patch) Scala Version, Docs, Builds (#2) 2024-04-15 02:06:45 +00:00

gs-slug

GS Open Source | License (MIT)

Scala 3 Slugs. Slugs are URL-safe restricted string identifiers.

Usage

This artifact is available in the Garrity Software Maven repository.

externalResolvers +=
  "Garrity Software Releases" at "https://maven.garrity.co/gs"

val GsSlug: ModuleID =
  "gs" %% "gs-slug-v0" % "0.1.0"

Slug Type

Slug is the type exposed by this library. It is an extremely small, restricted, opaque type (String) that adheres to the following regular expression:

^[a-z0-9]+(?:\-[a-z0-9]+)*$

This type is intended for use in the following scenarios:

  • Restricted ASCII is acceptable.
  • URL safety is desired.

Additionally, Slug is usually intended to be unique within some context, where the implementation defines the context. For example, if some organization owns a number of repositories, each repository might have a Slug which is unique within that organization.

Donate

Enjoy this project or want to help me achieve my goals? Consider Donating to Pat on Ko-fi.