Skip to content

v3.0.0

Compare
Choose a tag to compare
@aljoshakoecher aljoshakoecher released this 06 Sep 11:45
· 9 commits to master since this release
e271671

Adds another breaking change to the API

  • There are now three utility functions that have to be called to get the final result after calling convertToDefinition(). These functions were necessary to create a result similar to an original SPARQL query result in case there are no results. The functions are:
    • getAll() ->Returns the output that was previously returned by convertToDefinition(), i.e. the complete mapped object
    • getFirstRootElement() -> Convenient helper in case there is just one root element. Returns the grouped content for this element
    • get(key: string) -> Returns the mapped content of a root element given by key
  • Furthermore, you can now specify whether or not you want to keep all ungrouped elements as "children". This is done by setting the boolean parameter keepUngroupedContents in convertToDefinition(inputArray, mappingDefinitions, keepUngroupedContents). It's true by default.