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-0.3.0.tbz
sha256=c975d7d8d193946e268722538621aa4f99acdfcd7ead6a72157a2db80b98cb28
sha512=f799d6f44486ca7a780bb8d9d976056548b37cdf5211dd7608c32d65e1766ae9f4e113c03cfcfb9d0ba546adaf20e1176bc5531f9a5ca8c6c04497e5c76ba991

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)