mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-10 08:39:08 +03:00
lib.strings.isConvertibleWithToString: Refactor to reuse isStringLike
This commit is contained in:
parent
834f0d660a
commit
23c25d5231
@ -810,10 +810,9 @@ rec {
|
||||
null, bool, list of similarly coercible values.
|
||||
*/
|
||||
isConvertibleWithToString = x:
|
||||
elem (typeOf x) [ "path" "string" "null" "int" "float" "bool" ] ||
|
||||
(isList x && lib.all isConvertibleWithToString x) ||
|
||||
x ? outPath ||
|
||||
x ? __toString;
|
||||
isStringLike x ||
|
||||
elem (typeOf x) [ "null" "int" "float" "bool" ] ||
|
||||
(isList x && lib.all isConvertibleWithToString x);
|
||||
|
||||
/* Check whether a value can be coerced to a string.
|
||||
The value must be a string, path, or attribute set.
|
||||
|
Loading…
Reference in New Issue
Block a user