Comparing version 1.6.1 to 1.7.0
{ | ||
"name": "groq-js", | ||
"version": "1.6.1", | ||
"version": "1.7.0", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "sanity", |
@@ -163,3 +163,3 @@ import debug from 'debug' | ||
$trace('object.conditional.splat.condition %O', condition) | ||
if (condition) { | ||
if (condition || condition === undefined) { | ||
const value = walk({node: attr.value, scope}) | ||
@@ -172,4 +172,15 @@ | ||
} | ||
const attribute = node.attributes[name] | ||
attributes[name] = node.attributes[name] | ||
if (condition) { | ||
attributes[name] = attribute | ||
} else if (condition === undefined) { | ||
attributes[name] = { | ||
type: 'objectAttribute', | ||
value: attribute.value, | ||
optional: true, | ||
} | ||
} else { | ||
throw new Error('Unexpected condition') | ||
} | ||
} | ||
@@ -176,0 +187,0 @@ }) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
878799
12467