package dkml-install

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.2.0.tar.gz
md5=d65935d6a9a790fec09cfc50f6b04c43
sha512=08aeffeffa41b10ca54c9329bf9f6ec9219060c2e62c3a389d08b096513fe3dc048782e28d5006cae6a35e124cfd09441eb41a063c6a3f12fc6e60fa9d2acef7

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)