mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
lib/types: make pattern of strMatching accessible
This commit is contained in:
parent
d2dfc1ac21
commit
ad7b2f3438
1 changed files with 5 additions and 0 deletions
|
@ -443,6 +443,11 @@ rec {
|
||||||
descriptionClass = "noun";
|
descriptionClass = "noun";
|
||||||
check = x: str.check x && builtins.match pattern x != null;
|
check = x: str.check x && builtins.match pattern x != null;
|
||||||
inherit (str) merge;
|
inherit (str) merge;
|
||||||
|
functor = defaultFunctor "strMatching" // {
|
||||||
|
type = payload: strMatching payload.pattern;
|
||||||
|
payload = { inherit pattern; };
|
||||||
|
binOp = lhs: rhs: if lhs == rhs then lhs else null;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Merge multiple definitions by concatenating them (with the given
|
# Merge multiple definitions by concatenating them (with the given
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue