package dkml-install

  1. Overview
  2. Docs
API and registry for DkML installation components

Install

dune-project
 Dependency

Authors

Maintainers

Sources

src.tar.gz
md5=4636532b5971d7aa058b492448b02908
sha512=66e28e6c47b3de638601f0002289849d9af6bcbb9a2eb816d1dfe640bf3e5a350ad16b99d88b474b7be2482de480b5dd1fad4dbf87c702ee421bc033a3ca1327

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)