mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
types.singleLineStr: Disallow \r
This commit is contained in:
parent
df590070b0
commit
f25a13212b
@ -302,9 +302,8 @@ rec {
|
||||
|
||||
singleLineStr = mkOptionType {
|
||||
name = "singleLineStr";
|
||||
description = "string that doesn't contain '\\n'";
|
||||
check = x: str.check x && !(lib.hasInfix "\n" x);
|
||||
inherit (str) merge;
|
||||
description = "string that doesn't contain [\\n\\r]";
|
||||
inherit (strMatching "[^\n\r]*") check merge;
|
||||
};
|
||||
|
||||
strMatching = pattern: mkOptionType {
|
||||
|
Loading…
Reference in New Issue
Block a user