Age | Commit message (Collapse) | Author | Files | Lines | |
---|---|---|---|---|---|
2023-06-22 | lib: simplify stringToCharacters | figsoda | 1 | -1/+2 | |
2023-06-15 | lib.path.hasPrefix: init | Silvan Mosberger | 1 | -1/+2 | |
2023-04-04 | Merge pull request #221204 from tweag/deprecate-paths-to-strings | Silvan Mosberger | 1 | -11/+75 | |
lib.strings: Prevent paths as inputs in some functions | |||||
2023-03-15 | lib.strings.remove{Prefix,Suffix}: Deprecate for path prefix/suffix arguments | Silvan Mosberger | 1 | -5/+23 | |
See also parent commits | |||||
2023-03-15 | lib.strings.normalizePath: Deprecate for path values | Silvan Mosberger | 1 | -1/+14 | |
There's no need to call this function on path data types, and it's confusing with the new lib.path library functions | |||||
2023-03-15 | lib.strings: Deprecate path prefix/suffix/infix arguments | Silvan Mosberger | 1 | -5/+38 | |
lib.{hasPrefix,hasInfix,hasSuffix} would otherwise return an always-false result, which can be very unexpected: nix-repl> lib.strings.hasPrefix ./lib ./lib/meta.nix false | |||||
2023-03-04 | lib/strings: hide asciiTable | Naïm Favier | 1 | -2/+2 | |
Since it's an attribute set, the lib function location generating code tries to generate locations for each of the characters... | |||||
2023-03-03 | strings: add escapeQuery for url encoding | Patrick Widmer | 1 | -3/+18 | |
2023-01-31 | Merge pull request #205557 from ncfavier/concatLines | Silvan Mosberger | 1 | -0/+11 | |
lib/strings: add `concatLines` | |||||
2022-12-31 | lib.isStringLike: Remove use of list | Robert Hensing | 1 | -1/+3 | |
In the current implementation of Nix, this list would be allocated over and over. Iirc pennae tried to optimize static list allocation, but gained no significant performance improvement. | |||||
2022-12-31 | lib.strings.isConvertibleWithToString: Refactor to reuse isStringLike | Robert Hensing | 1 | -4/+3 | |
2022-12-31 | lib.strings: isMoreCoercibleString -> isConvertibleWithToString | Robert Hensing | 1 | -5/+6 | |
Yes, this function name is inconveniently long, but it is important for the name to explicitly reference the function and not be mistaken for the implicit string conversions, which only happen for a smaller set of values. | |||||
2022-12-31 | lib.strings: isSimpleCoercibleString -> isStringLike | Robert Hensing | 1 | -7/+7 | |
2022-12-31 | treewide: isCoercibleToString -> isMoreCoercibleToString | Robert Hensing | 1 | -1/+1 | |
No change in behavior. | |||||
2022-12-31 | lib.strings: Rename isCoercibleToString -> isMoreCoercibleToString | Robert Hensing | 1 | -2/+11 | |
2022-12-31 | lib.strings.toShellVar: Use isSimpleCoercibleString | Robert Hensing | 1 | -1/+1 | |
Expecting no change in behavior. | |||||
2022-12-31 | lib.strings.isStorePath: Use isSimpleCoercibleToString | Robert Hensing | 1 | -1/+1 | |
Expecting no change in behavior. | |||||
2022-12-31 | lib.strings: Add isSimpleCoercibleToString | Robert Hensing | 1 | -0/+11 | |
2022-12-20 | lib/strings: replace poop emoji (#206999) | Naïm Favier | 1 | -1/+1 | |
2022-12-17 | lib: fix typos | figsoda | 1 | -2/+2 | |
2022-12-15 | lib.replaceChars: warn about being a deprecated alias | Artturin | 1 | -17/+6 | |
replaceStrings has been in nix since 2015(nix 1.10) so it is safe to remove the fallback https://github.com/nixos/nix/commit/d6d5885c1567454754a0d260521bafa0bd5e7fdb | |||||
2022-12-11 | Merge pull request #205457 from ↵ | Robert Hensing | 1 | -6/+7 | |
h7x4/lib-strings-toInt-broken-for-negative-numbers lib.strings: fix negative number handling for `toInt` and `toIntBase10` | |||||
2022-12-10 | lib/strings: add `concatLines` | Naïm Favier | 1 | -0/+11 | |
Like `unlines` from Haskell. The aim is to replace the `concatStringsSep "\n"` pattern for generated files, which doesn't add a final newline. | |||||
2022-12-10 | lib.strings: fix negative number handling for `toInt` and `toIntBase10` | h7x4 | 1 | -6/+7 | |
The previous version would be unstable due to an input validation regex not expecting a '-' in front of the number. | |||||
2022-12-08 | Merge pull request #204087 from ncfavier/splitString-simplify | Naïm Favier | 1 | -6/+4 | |
2022-12-06 | lib/strings.nix: add mesonOption utility function | AndersonTorres | 1 | -0/+55 | |
And some friends, to help write Meson commandline invocations. | |||||
2022-12-02 | lib/strings: simplify `splitString` | Naïm Favier | 1 | -6/+4 | |
There's no need to use `unsafeDiscardStringContext` since https://github.com/NixOS/nix/commit/ee7fe64c0ac00f2be11604a2a6509eb86dc19f0a (Nix 1.8). Also the separator can't have a context since `builtins.split` would fail, so we can assume it doesn't. | |||||
2022-10-24 | Merge pull request #173949 from jacoblambda/fix-toInt-zero-padding | Robert Hensing | 1 | -6/+87 | |
lib: add strings.toIntBase10 to parse zero-padded strings | |||||
2022-10-24 | lib.normalizePath: the empty string is not a valid regex on darwin | Guillaume Girol | 1 | -1/+1 | |
presumably due to using libc++'s regex lib instead of libstdc++ on linux Fixes https://github.com/NixOS/nixpkgs/pull/177273#issuecomment-1287562800 | |||||
2022-10-23 | lib/strings: Update docs and restructured code to improve readability of ↵ | Jacob Abel | 1 | -21/+37 | |
toInt and toIntBase10. | |||||
2022-10-23 | lib/strings: Improve error message for octal ambiguity in toInt | Jacob Abel | 1 | -3/+2 | |
2022-10-23 | lib/strings: Refactor toInt into toInt and toIntBase10 | Jacob Abel | 1 | -3/+51 | |
2022-10-23 | lib/strings: Update toInt to handle intermixed ws and zeros. Added tests | Jacob Abel | 1 | -7/+13 | |
2022-10-23 | lib/strings: allow toInt to parse zero-padded strings | Jacob Abel | 1 | -4/+16 | |
2022-10-20 | lib.strings: Add normalizePath | ajs124 | 1 | -0/+10 | |
dedupes extranous /'s in filepaths Co-authored-by: Daniel Olsen <daniel.olsen99@gmail.com> | |||||
2022-10-20 | lib.strings: Add function to do C-style escaping | Daniel Olsen | 1 | -0/+13 | |
2022-10-20 | lib.strings: Add function to convert character to number | Daniel Olsen | 1 | -0/+15 | |
2022-05-07 | lib/strings/toShellVars: handle derivations as strings | Naïm Favier | 1 | -4/+5 | |
2022-05-01 | lib/strings: convert to string within hasInfix | Daniel Thwaites | 1 | -1/+1 | |
This should fix the issue mentioned here: https://github.com/NixOS/nixpkgs/pull/168175#issuecomment-1107830574 | |||||
2022-04-27 | lib/strings: fix quoting of example | Naïm Camille Favier | 1 | -1/+1 | |
Co-authored-by: Silvan Mosberger <github@infinisil.com> | |||||
2022-04-27 | lib/strings: add toShellVars | Naïm Favier | 1 | -0/+60 | |
A straightforward piece of plumbing to safely inject Nix variables into shell scripts: '' ${lib.toShellVars { inherit foo bar; }} cmd "$foo" --bar "$bar" '' | |||||
2022-04-22 | lib/strings: optimise hasInfix function (#168175) | Daniel Thwaites | 1 | -4/+1 | |
* lib/strings: optimise hasInfix function * lib/strings: optimise hasInfix further using regex * rstudio: call hasInfix with a string * lib/strings: remove let from hasInfix Co-authored-by: pennae <82953136+pennae@users.noreply.github.com> Co-authored-by: pennae <82953136+pennae@users.noreply.github.com> | |||||
2022-04-05 | Merge pull request #166383 from hercules-ci/always-sanitize-derivation-name | Robert Hensing | 1 | -1/+8 | |
Always sanitize derivation name | |||||
2022-04-05 | lib.sanitizeDerivationName: Simplify regex | Robert Hensing | 1 | -1/+1 | |
`^` and `$` are implicit in `match`. | |||||
2022-04-01 | lib/strings: Add levenshtein distance functions | Silvan Mosberger | 1 | -0/+127 | |
Adds some functions related to string similarity: - lib.strings.commonPrefixLength - lib.strings.commonSuffixLength - lib.strings.levenshtein - lib.strings.levenshteinAtMost | |||||
2022-03-31 | lib.sanitizeDerivationName: Optimize the common case | Robert Hensing | 1 | -1/+8 | |
2021-11-02 | lib: fix escapeXML example in documentation | Robert Helgesson | 1 | -1/+1 | |
The previous example output was forgotten copy-paste from some other function. | |||||
2021-10-03 | lib: add function escapeXML | Robert Helgesson | 1 | -0/+13 | |
Given a string, this function returns a string that can be inserted verbatim in an XML document. | |||||
2021-08-26 | lib/strings: fix infinite recursion on concatStringsSep fallback | polykernel | 1 | -1/+1 | |
The current implementation of the concatStringsSep fallback references concatStrings whcih is just a partial application of concatStringsSep, forming a circular dependency. Although this will almost never be encountered as (assuming the user does not explicitly trigger it): 1. the or operator will short circuit both in lazy and strict evaluation 2. this can only occur in Nix versions prior to 1.10 which is not compatible with various nix operations as of 2.3.15 However it is still important if scopedImport is used or the builtins have been overwritten. lib.foldl' is used instead of builtins.foldl' as the foldl' primops was introduced in the same release as concatStringsSep. | |||||
2021-07-04 | strings.nix: Fix overly monomorphic type signature comments | Niklas Hambüchen | 1 | -2/+2 | |
These functions work on lists of anything, not just lists of strings. |