# `WardrikWorkspace.Path`

Paths and globs within a workspace.

A path names a file, as `notes/today.md`. `normalize/1` drops `.` segments and repeated slashes.
It refuses a path that:

  * starts with `/` or `~`
  * contains a `..` segment
  * contains a NUL or a backslash
  * is longer than 1,024 bytes

Folders are just path prefixes, so there's nothing to create.

A glob matches whole paths:

  * `*` - any characters within one folder.
  * `?` - one character.
  * `**` - any characters across folders.

For example, `notes/*.md` matches the Markdown files in `notes`, and `**/*.md` matches all of
them.

# `compile`

```elixir
@spec compile(String.t()) :: Regex.t()
```

Compiles `glob` to a regular expression.

# `match?`

```elixir
@spec match?(String.t(), String.t()) :: boolean()
```

Returns whether `glob` matches `path`.

# `normalize`

```elixir
@spec normalize(term()) :: {:ok, String.t()} | {:error, String.t()}
```

Normalises `path`. Returns `{:error, reason}` if it isn't a valid path.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
