   ], cb
 
 
+# Turns multiple *Element* nodes containing array or enum item into
+# 'resolved item' objects with both representation in JSON Schema and
+# optionally also some additional info.
 resolveItems = (items, inherited, cb) ->
   async.mapSeries items, (item, next) ->
     resolveItem item, inherited, next

  cb null, {inline: true, nonPrimitiveItems: [], groups: [group]}


inspectEnum = (enumElement, resolvedType, cb) ->
  return cb new Error "Multiple nested types for enum." if resolvedType.nested.length > 1
  nestedTypeName = resolvedType.nested?[0]

{resolveType, resolveTypes} = require '../typeresolution'


# Coerces multiple literals to JSON Schema values in given type.
coerceLiterals = (literals, typeName, cb) ->
  async.mapSeries literals, (literal, next) ->
    coerceLiteral literal, typeName, next
