All checks were successful
/ Build and Release Library (push) Successful in 1m15s
39 lines
958 B
Markdown
39 lines
958 B
Markdown
# gs-slug
|
|
|
|
[License (Apache 2.0)](./LICENSE)
|
|
|
|
Scala 3 Slugs. Slugs are URL-safe restricted string identifiers.
|
|
|
|
- [Usage](#usage)
|
|
|
|
## Usage
|
|
|
|
This artifact is available in the Garrity Software Maven repository.
|
|
|
|
```scala
|
|
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.
|