mwg API
    Preparing search index...

    Function compileNodes

    • Compile an already-parsed MWL node tree. A game that builds its nodes from another format (the Wesnoth port converts its own parsed nodes this way) can validate and compile through the same schema without going back to text.

      Parameters

      Returns MwlCompiledGame

      import { compileNodes, parse } from '@datamoc/mw_games/mwl';

      const game = compileNodes(parse("[{ tag: 'game', schema: 0.1 }]"));
      console.log(game.schema); // '0.1'