UNPKG

@gamepark/rules-api

Version:

API to implement the rules of a board game

11 lines 294 B
/** * Type guard to know if a game implements the Undo feature. * * @param rules Rules of the game * @returns true if rules implements {@link Undo} */ export function hasUndo(rules) { const test = rules; return typeof test.canUndo === 'function'; } //# sourceMappingURL=Undo.js.map