mwg API
    Preparing search index...

    Function readAttributes

    • Read a compiled node with one shared coercion and diagnostic policy.

      Type Parameters

      • T extends Record<string, unknown>

      Parameters

      Returns MwlReadResult<T>

      import { compile, readAttributes } from '@datamoc/mw_games/mwl';

      const game = compile("[{ tag: 'game', schema: 0.1 }]");
      const { value } = readAttributes(game.roots[0]!, { schema: { type: 'string' } });
      console.log(value.schema); // '0.1'