]> granicus.if.org Git - jq/commitdiff
Also add `scalars`
authorNicolas Williams <nico@cryptonector.com>
Thu, 13 Mar 2014 05:16:33 +0000 (00:16 -0500)
committerNicolas Williams <nico@cryptonector.com>
Thu, 13 Mar 2014 05:29:53 +0000 (00:29 -0500)
builtin.c

index da766e16da7e88b7f671b778e4bfc93699f15da7..480fb8ae6cbcc455d50bb690d6f8289f291dd637 100644 (file)
--- a/builtin.c
+++ b/builtin.c
@@ -691,6 +691,7 @@ static const char* const jq_builtins[] = {
   "def strings: select(type == \"string\");",
   "def nulls: select(type == \"null\");",
   "def values: arrays, objects, booleans, numbers, strings;",
+  "def scalars: select(. == null or . == true or . == false or type == \"number\" or type == \"string\");",
 };
 #undef LIBM_DD