mwg API
    Preparing search index...

    Function validateHookAttributes

    • Check one [hook] call's own attributes against its declaration. Returns nothing for a hook the game declares without attributes: an undeclared shape is not this function's to invent.

      Parameters

      Returns MwlDiagnostic[]

      import { validateHookAttributes } from '@datamoc/mw_games/mwl';

      const node = { tag: 'hook', attributes: { name: 'command:mark', value: 'ok' }, children: [], location: undefined };
      console.log(validateHookAttributes(node, { id: 'command:mark', attributes: { value: 'string' } })); // []