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.
import { compileNodes, parse } from '@datamoc/mw_games/mwl';const game = compileNodes(parse("[{ tag: 'game', schema: 0.1 }]"));console.log(game.schema); // '0.1' Copy
import { compileNodes, parse } from '@datamoc/mw_games/mwl';const game = compileNodes(parse("[{ tag: 'game', schema: 0.1 }]"));console.log(game.schema); // '0.1'
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.