query
On this page

separatedString

lib.types.separatedString

Docs pulled from | This Revision | 16 minutes ago


separator between the values).


Noogle detected

Implementation

The following is the current implementation of this function.

separatedString =
        sep:
        mkOptionType rec {
          name = "separatedString";
          description =
            if sep == "" then
              "Concatenated string" # for types.string.
            else
              "strings concatenated with ${builtins.toJSON sep}";
          descriptionClass = "noun";
          check = isString;
          merge = loc: defs: concatStringsSep sep (getValues defs);
          functor = (defaultFunctor name) // {
            payload = { inherit sep; };
            type = payload: types.separatedString payload.sep;
            binOp = lhs: rhs: if lhs.sep == rhs.sep then { inherit (lhs) sep; } else null;
          };
        };