package dkml-install

  1. Overview
  2. Docs
API and registry for Diskuv OCaml (DKML) installation components

Install

dune-project
 Dependency

Authors

Maintainers

Sources

dkml-install-api-0.4.0.tar.gz
md5=1b3f42a06b0643eb502e6f65d1769b98
sha512=55d47cb8c570f3e9fbdb5f4f7960c86fbe357df6c5364c82c9eb326150693fa1dbffe3fa3f5682e355f770c5f3c53bd7ce88ec1d1d9eefecceb8f44ed8b1d326

doc/src/dkml-install.register/validate.ml.html

Source file validate.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
open Dkml_install_api
open Astring

let validate (module Cfg : Component_config) =
  let alphanumeric c =
    (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c = '-'
  in
  if String.for_all alphanumeric Cfg.component_name then Ok ()
  else
    Error
      (Fmt.str
         "[19c415af]: The component_name must be alphanumeric with only dashes \
          (-) allowed. Instead the component name was: %s"
         Cfg.component_name)