Commit graph

13 commits

Author SHA1 Message Date
Matt Sturgeon
6dc0bda459
lib/to-lua: handle derivations as path strings
Fixes #1888
2024-07-22 13:24:16 +01:00
Matt Sturgeon
9b25eaaa6f
lib/to-lua: fix removing empties nested in lists
- Add options for removing empty/null list entries (default false)
- Fix recursion into attrs that are themselves list entries

Fixes #1804
2024-07-03 16:44:30 +01:00
Matt Sturgeon
aff12581d8
lib/lua: refactor toLuaObject, now configurable
Heavily based on nixpkgs lib.generators.toPretty
2024-06-28 22:44:43 +01:00
Matt Sturgeon
53a9599cc4
lib/lua: pad table , with a space
Makes toLuaObject's output a little more readable.
2024-06-26 12:35:47 +01:00
Matt Sturgeon
00ce71f51a
lib/lua: only quote table keys when needed 2024-06-26 12:31:05 +01:00
Matt Sturgeon
01cf43dbaa
lib/lua: add isKeyword and isIdentifier
Allow testing whether a string is a valid lua identifier or a reserved
keyword.
2024-06-26 11:40:52 +01:00
Matt Sturgeon
c16533b3f7
lib: add upperFirstChar
A util function to capitalize the first character of a string.
2024-06-07 09:17:29 +01:00
traxys
62f32bfc71 treewide: Reformat with nixfmt 2024-05-05 22:00:40 +02:00
Gaetan Lepage
a121d96091 tests: do not import helpers.nix directly 2024-02-11 11:50:35 +01:00
Gaetan Lepage
b6724702b4 misc: refactor imports, prefer adding helpers to args rather than importing it 2023-11-06 16:33:39 +01:00
municorn
934bf7e2e3
fix(helpers): use "__unkeyed" prefix instead of "@" in toLuaObject (#632) 2023-10-09 15:50:21 +02:00
Gaétan Lepage
35c56b62a1
helpers/lib: toLuaObject ignore empty attrs (#312) 2023-04-03 11:25:37 +02:00
*Kim Zick
7f50b54bfb
tests/lib: Add basic unit tests for helpers.toLuaObject (#291) 2023-03-26 11:03:51 +02:00