Skip to content

Commit

Permalink
Migrate to ES modules (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
102 authored Jul 4, 2023
1 parent 16d6d76 commit c268255
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @param {bigint} y
* @returns {bigint}
*/
function F(n, x, y) {
export function F(n, x, y) {
if (n === 0n) {
return x + y;
}
Expand All @@ -15,5 +15,3 @@ function F(n, x, y) {

return F(n - 1n, F(n, x, y - 1n), F(n, x, y - 1n) + y);
}

module.exports = F;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"author": "Roman Gusev <rgusev2@gmail.com>",
"license": "MIT",
"type": "module",
"scripts": {
"test": "node test.js"
},
Expand Down
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let assert = require("assert");
let F = require("./index");
import assert from "node:assert";
import { F } from "./index.js";

let cases = [
[0n, 0n, 0n, 0n],
Expand Down

0 comments on commit c268255

Please sign in to comment.