1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

Add a toJSON primop

This commit is contained in:
Eelco Dolstra 2013-11-19 00:03:11 +01:00
parent 285df765b9
commit 77c13cdf56
10 changed files with 179 additions and 24 deletions

View file

@ -750,6 +750,18 @@ in foo</programlisting>
</varlistentry>
<varlistentry><term><function>builtins.toJSON</function> <replaceable>e</replaceable></term>
<listitem><para>Return a string containing a JSON representation
of <replaceable>e</replaceable>. Strings, integers, booleans,
nulls and lists are mapped to their JSON equivalents. Sets
(except derivations) are represented as objects. Derivations are
translated to a JSON string containing the derivations output
path. Paths are copied to the store and represented as a JSON
string of the resulting store path.</para></listitem>
</varlistentry>
<varlistentry><term><function>builtins.toPath</function> <replaceable>s</replaceable></term>
<listitem><para>Convert the string value

View file

@ -13,6 +13,11 @@
<itemizedlist>
<listitem>
<para>New built-in function: <function>builtins.toJSON</function>,
which returns a JSON representation of a value.</para>
</listitem>
<listitem><para><command>nix-setuid-helper</command> is
gone.</para></listitem>