UNPKG

@metamask/snaps-simulation

Version:

A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment

25 lines 768 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatTypeErrorMessage = void 0; /** * Format types for error messages based on the number of types. * * @param types - Array of type names. * @returns Formatted string for error message. */ function formatTypeErrorMessage(types) { if (types.length === 1) { return `"${types[0]}"`; } if (types.length === 2) { return `"${types[0]}" or "${types[1]}"`; } const lastType = types[types.length - 1]; const otherTypes = types .slice(0, -1) .map((type) => `"${type}"`) .join(', '); return `${otherTypes} or "${lastType}"`; } exports.formatTypeErrorMessage = formatTypeErrorMessage; //# sourceMappingURL=errors.cjs.map