feat: make it esm

This commit is contained in:
2022-10-28 18:38:57 +02:00
parent 2f42a71f0a
commit 7603a07731
2 changed files with 5 additions and 16 deletions

View File

@@ -1,17 +1,4 @@
"use strict";
/**
* @example
* // should return player1 (the winner)
* rockpaperscissors(2, 1)
* @example
* // should return tie (it's a tie)
* rockpaperscissors(1, 1)
* @description Main function, you need to pass 2 numbers.
* @param {number} player1 1 for rock, 2 for paper, 3 for scissors
* @param {number} player2 1 for rock, 2 for paper, 3 for scissors
* @returns {string} either "player1", "player2" (whoever won) or "tie" for a tie.
*/
exports.__esModule = true;
function rockpaperscissors(player1, player2) {
if (player1 === player2) {
return "tie";
@@ -38,4 +25,5 @@ function rockpaperscissors(player1, player2) {
throw new Error("Make sure player1 and player2 have right numbers.");
}
}
exports["default"] = rockpaperscissors;
export const __esModule = true;
export default rockpaperscissors;

View File

@@ -1,8 +1,9 @@
{
"name": "rockpaperscissors-checker",
"version": "1.1.2",
"version": "1.2.0",
"description": "check for ties and wins on rockpaperscissors",
"main": "index.js",
"type": "module",
"main": "./index.js",
"scripts": {
"test": "node ."
},