diff --git a/dogfood/.editorconfig b/dogfood/.editorconfig index 6a1c21e..3ad7d61 100644 --- a/dogfood/.editorconfig +++ b/dogfood/.editorconfig @@ -5,3 +5,5 @@ trim_trailing_whitespace = true insert_final_newline = true max_line_length = 80 tab_width = 2 +indent_size = 4 +indent_style = space diff --git a/dogfood/README.md b/dogfood/README.md index 8bb9543..d146301 100644 --- a/dogfood/README.md +++ b/dogfood/README.md @@ -52,3 +52,20 @@ npm ci node --test ``` +## Running your own RCE instance + +To bypass the token limit at have a local (or nearby) running instance of Pesto's RCE, +you can set up your own by running these Docker commands: + +```bash +docker pull ghcr.io/teknologi-umum/pesto-rce:edge + +docker run -p 50051:50051 -e ENVIRONMENT=production ghcr.io/teknologi-umum/pesto-rce:edge +``` + +Then, you should set your RCE API URL to `http://localhost:50051`. + +Beware that the RCE Docker image is around 4 GB. That being said, it is highly recommended +if you pull the Docker image from a device that have high internet speed. For us, we use +a virtual machine that runs the Docker image, expose it to private Wireguard network, +and call the RCE image through private IP address. diff --git a/dogfood/c.test.js b/dogfood/c.test.js index b6137f9..5bb3e3b 100644 --- a/dogfood/c.test.js +++ b/dogfood/c.test.js @@ -45,20 +45,20 @@ void fizzbuzz(int num) const codeOutput = await pestoClient.execute({ language: "C", version: "latest", - code, + code }); const expectedOutput = "1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n11\nFizz\n13\n14\nFizzBuzz\n16\n17\nFizz\n19\nBuzz\nFizz\n22\n23\nFizz\nBuzz\n26\nFizz\n28\n29\nFizzBuzz\n31\n32\nFizz\n34\nBuzz\nFizz\n37\n38\nFizz\nBuzz\n41\nFizz\n43\n44\nFizzBuzz\n46\n47\nFizz\n49\nBuzz\nFizz\n52\n53\nFizz\nBuzz\n56\nFizz\n58\n59\nFizzBuzz\n61\n62\nFizz\n64\nBuzz\nFizz\n67\n68\nFizz\nBuzz\n71\nFizz\n73\n74\nFizzBuzz\n76\n77\nFizz\n79\nBuzz\nFizz\n82\n83\nFizz\nBuzz\n86\nFizz\n88\n89\nFizzBuzz\n91\n92\nFizz\n94\nBuzz\nFizz\n97\n98\nFizz\nBuzz"; assert.strictEqual(codeOutput.language, "C"); - assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); - assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); - assert.strictEqual(codeOutput.runtime.stderr, ""); - assert.strictEqual(codeOutput.runtime.exitCode, 0); - assert.strictEqual(codeOutput.compile.stdout, ""); assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); assert.strictEqual(codeOutput.compile.stderr, ""); assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); }); @@ -91,12 +91,79 @@ void merge_sort (int *a, int n) { } int main () { - int a[] = {4, 65, 2, -31, 0, 99, 2, 83, 782, 1}; + int a[] = {2, 8, 3, 10, 13, 6, 11, 9, 19, 15, 5, 4, 12, 14, 20, 1, 17, 18, 16, 7}; int n = sizeof a / sizeof a[0]; int i; + merge_sort(a, n); for (i = 0; i < n; i++) printf("%d%s", a[i], i == n - 1 ? "\\n" : " "); - merge_sort(a, n); + return 0; +}`; + + const codeOutput = await pestoClient.execute({ + language: "C", + version: "latest", + code: code + }); + + const expectedOutput = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"; + + assert.strictEqual(codeOutput.language, "C"); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + }); + + it("Heap Sort", async () => { + const code = `#include + +int max (int *a, int n, int i, int j, int k) { + int m = i; + if (j < n && a[j] > a[m]) { + m = j; + } + if (k < n && a[k] > a[m]) { + m = k; + } + return m; +} + +void downheap (int *a, int n, int i) { + while (1) { + int j = max(a, n, i, 2 * i + 1, 2 * i + 2); + if (j == i) { + break; + } + int t = a[i]; + a[i] = a[j]; + a[j] = t; + i = j; + } +} + +void heapsort (int *a, int n) { + int i; + for (i = (n - 2) / 2; i >= 0; i--) { + downheap(a, n, i); + } + for (i = 0; i < n; i++) { + int t = a[n - i - 1]; + a[n - i - 1] = a[0]; + a[0] = t; + downheap(a, n - i - 1, 0); + } +} + +int main () { + int a[] = {2, 8, 3, 10, 13, 6, 11, 9, 19, 15, 5, 4, 12, 14, 20, 1, 17, 18, 16, 7}; + int n = sizeof a / sizeof a[0]; + int i; + heapsort(a, n); for (i = 0; i < n; i++) printf("%d%s", a[i], i == n - 1 ? "\\n" : " "); return 0; @@ -105,19 +172,183 @@ int main () { const codeOutput = await pestoClient.execute({ language: "C", version: "latest", - code: code, + code: code }); - const expectedOutput = "4 65 2 -31 0 99 2 83 782 1\n-31 0 1 2 2 4 65 83 99 782"; + const expectedOutput = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"; assert.strictEqual(codeOutput.language, "C"); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + }); + + it("Sieve of Erastosthenes", async () => { + const code = `#include +#include +#include +#include +#include + +#define true (1) +#define false (0) +typedef unsigned char bool; + +#define MAX 10000000 + +/* to_int: converts a character array to an integer, returns -1 on error, -2 on out of limits */ +int to_int(char* inp) { + int len = strlen(inp); + unsigned int out = 0, prev_out = 0, mult = 1; + + if (len == 0) { + return -1; + } + + for (int i = len - 1; i >= 0; i--) { + if (inp[i] < 48 || inp[i] > 57) { + return -1; + } + + prev_out = out; + out += (inp[i] - 48) * mult; + mult *= 10; + + /* detect wrapping */ + if (out < prev_out) { + return -2; + } + } + + return out; +} + +int main() { + int max = 100; + + /* Set up the list */ + bool *list = NULL; + if ((list = malloc(max)) == NULL) { + fprintf(stderr, "Error! Could not allocate the requested amount of memory: %s\\nExiting...\\n", strerror(errno)); + return EXIT_FAILURE; + } + + memset(list, true, max); + + int max_sqrt = sqrt(max); + + for (int i = 2; i <= max_sqrt; i++) { + if (list[i]) { + for (int j = i*i; j <= max; j += i) { + list[j] = false; + } + } + } + + for (int i = 2; i < max; i++) { + if (list[i]) { + printf("%d ", i); + } + } + + free(list); + + return 0; +}`; + + const codeOutput = await pestoClient.execute({ + language: "C", + version: "latest", + code: code + }); + + const expectedOutput = "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97"; + + assert.strictEqual(codeOutput.language, "C"); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.stderr, ""); assert.strictEqual(codeOutput.runtime.exitCode, 0); + }); + + it("99 Bottles", async () => { + const code = `#include + +int main(void) +{ + int n; + + for(n = 99; n > 0; n--) { + printf( + "%d bottles of beer on the wall, %d bottles of beer.\\n" + "Take one down, pass it around, %d bottles of beer on the wall\\n\\n", + n, n, n - 1); + } + + return 0; +}`; + + const codeOutput = await pestoClient.execute({ + language: "C", + version: "latest", + code: code + }); + + const expectedOutput = "99 bottles of beer on the wall, 99 bottles of beer.\nTake one down, pass it around, 98 bottles of beer on the wall\n\n98 bottles of beer on the wall, 98 bottles of beer.\nTake one down, pass it around, 97 bottles of beer on the wall\n\n97 bottles of beer on the wall, 97 bottles of beer.\nTake one down, pass it around, 96 bottles of beer on the wall\n\n96 bottles of beer on the wall, 96 bottles of beer.\nTake one down, pass it around, 95 bottles of beer on the wall\n\n95 bottles of beer on the wall, 95 bottles of beer.\nTake one down, pass it around, 94 bottles of beer on the wall\n\n94 bottles of beer on the wall, 94 bottles of beer.\nTake one down, pass it around, 93 bottles of beer on the wall\n\n93 bottles of beer on the wall, 93 bottles of beer.\nTake one down, pass it around, 92 bottles of beer on the wall\n\n92 bottles of beer on the wall, 92 bottles of beer.\nTake one down, pass it around, 91 bottles of beer on the wall\n\n91 bottles of beer on the wall, 91 bottles of beer.\nTake one down, pass it around, 90 bottles of beer on the wall\n\n90 bottles of beer on the wall, 90 bottles of beer.\nTake one down, pass it around, 89 bottles of beer on the wall\n\n89 bottles of beer on the wall, 89 bottles of beer.\nTake one down, pass it around, 88 bottles of beer on the wall\n\n88 bottles of beer on the wall, 88 bottles of beer.\nTake one down, pass it around, 87 bottles of beer on the wall\n\n87 bottles of beer on the wall, 87 bottles of beer.\nTake one down, pass it around, 86 bottles of beer on the wall\n\n86 bottles of beer on the wall, 86 bottles of beer.\nTake one down, pass it around, 85 bottles of beer on the wall\n\n85 bottles of beer on the wall, 85 bottles of beer.\nTake one down, pass it around, 84 bottles of beer on the wall\n\n84 bottles of beer on the wall, 84 bottles of beer.\nTake one down, pass it around, 83 bottles of beer on the wall\n\n83 bottles of beer on the wall, 83 bottles of beer.\nTake one down, pass it around, 82 bottles of beer on the wall\n\n82 bottles of beer on the wall, 82 bottles of beer.\nTake one down, pass it around, 81 bottles of beer on the wall\n\n81 bottles of beer on the wall, 81 bottles of beer.\nTake one down, pass it around, 80 bottles of beer on the wall\n\n80 bottles of beer on the wall, 80 bottles of beer.\nTake one down, pass it around, 79 bottles of beer on the wall\n\n79 bottles of beer on the wall, 79 bottles of beer.\nTake one down, pass it around, 78 bottles of beer on the wall\n\n78 bottles of beer on the wall, 78 bottles of beer.\nTake one down, pass it around, 77 bottles of beer on the wall\n\n77 bottles of beer on the wall, 77 bottles of beer.\nTake one down, pass it around, 76 bottles of beer on the wall\n\n76 bottles of beer on the wall, 76 bottles of beer.\nTake one down, pass it around, 75 bottles of beer on the wall\n\n75 bottles of beer on the wall, 75 bottles of beer.\nTake one down, pass it around, 74 bottles of beer on the wall\n\n74 bottles of beer on the wall, 74 bottles of beer.\nTake one down, pass it around, 73 bottles of beer on the wall\n\n73 bottles of beer on the wall, 73 bottles of beer.\nTake one down, pass it around, 72 bottles of beer on the wall\n\n72 bottles of beer on the wall, 72 bottles of beer.\nTake one down, pass it around, 71 bottles of beer on the wall\n\n71 bottles of beer on the wall, 71 bottles of beer.\nTake one down, pass it around, 70 bottles of beer on the wall\n\n70 bottles of beer on the wall, 70 bottles of beer.\nTake one down, pass it around, 69 bottles of beer on the wall\n\n69 bottles of beer on the wall, 69 bottles of beer.\nTake one down, pass it around, 68 bottles of beer on the wall\n\n68 bottles of beer on the wall, 68 bottles of beer.\nTake one down, pass it around, 67 bottles of beer on the wall\n\n67 bottles of beer on the wall, 67 bottles of beer.\nTake one down, pass it around, 66 bottles of beer on the wall\n\n66 bottles of beer on the wall, 66 bottles of beer.\nTake one down, pass it around, 65 bottles of beer on the wall\n\n65 bottles of beer on the wall, 65 bottles of beer.\nTake one down, pass it around, 64 bottles of beer on the wall\n\n64 bottles of beer on the wall, 64 bottles of beer.\nTake one down, pass it around, 63 bottles of beer on the wall\n\n63 bottles of beer on the wall, 63 bottles of beer.\nTake one down, pass it around, 62 bottles of beer on the wall\n\n62 bottles of beer on the wall, 62 bottles of beer.\nTake one down, pass it around, 61 bottles of beer on the wall\n\n61 bottles of beer on the wall, 61 bottles of beer.\nTake one down, pass it around, 60 bottles of beer on the wall\n\n60 bottles of beer on the wall, 60 bottles of beer.\nTake one down, pass it around, 59 bottles of beer on the wall\n\n59 bottles of beer on the wall, 59 bottles of beer.\nTake one down, pass it around, 58 bottles of beer on the wall\n\n58 bottles of beer on the wall, 58 bottles of beer.\nTake one down, pass it around, 57 bottles of beer on the wall\n\n57 bottles of beer on the wall, 57 bottles of beer.\nTake one down, pass it around, 56 bottles of beer on the wall\n\n56 bottles of beer on the wall, 56 bottles of beer.\nTak"; + + assert.strictEqual(codeOutput.language, "C"); + assert.strictEqual(codeOutput.compile.output, ""); assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + }); + + it("Factorial", async () => { + const code = `#include + +int factorial(int n) { + int result = 1; + for (int i = 1; i <= n; ++i) + result *= i; + return result; +} + +int main(void) +{ + printf("%d", factorial(10)); + + return 0; +}`; + + const codeOutput = await pestoClient.execute({ + language: "C", + version: "latest", + code: code + }); + + const expectedOutput = "3628800"; + + assert.strictEqual(codeOutput.language, "C"); assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); assert.strictEqual(codeOutput.compile.stderr, ""); assert.strictEqual(codeOutput.compile.exitCode, 0); - }) -}) + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + }); +}); diff --git a/dogfood/cpp.test.js b/dogfood/cpp.test.js index f624f42..1e1016b 100644 --- a/dogfood/cpp.test.js +++ b/dogfood/cpp.test.js @@ -36,20 +36,20 @@ void fizzbuzz(int num) const codeOutput = await pestoClient.execute({ language: "C++", version: "latest", - code, + code }); const expectedOutput = "1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n11\nFizz\n13\n14\nFizzBuzz\n16\n17\nFizz\n19\nBuzz\nFizz\n22\n23\nFizz\nBuzz\n26\nFizz\n28\n29\nFizzBuzz\n31\n32\nFizz\n34\nBuzz\nFizz\n37\n38\nFizz\nBuzz\n41\nFizz\n43\n44\nFizzBuzz\n46\n47\nFizz\n49\nBuzz\nFizz\n52\n53\nFizz\nBuzz\n56\nFizz\n58\n59\nFizzBuzz\n61\n62\nFizz\n64\nBuzz\nFizz\n67\n68\nFizz\nBuzz\n71\nFizz\n73\n74\nFizzBuzz\n76\n77\nFizz\n79\nBuzz\nFizz\n82\n83\nFizz\nBuzz\n86\nFizz\n88\n89\nFizzBuzz\n91\n92\nFizz\n94\nBuzz\nFizz\n97\n98\nFizz\nBuzz"; assert.strictEqual(codeOutput.language, "C++"); - assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); - assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); - assert.strictEqual(codeOutput.runtime.stderr, ""); - assert.strictEqual(codeOutput.runtime.exitCode, 0); - assert.strictEqual(codeOutput.compile.stdout, ""); assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); assert.strictEqual(codeOutput.compile.stderr, ""); assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); }); it("Cartesian equation", async () => { @@ -108,23 +108,264 @@ int main() { std::cin.ignore(); std::cin.get(); return 0; -}` +}`; const codeOutput = await pestoClient.execute({ language: "C++", version: "latest", - code: code, + code: code }); const expectedOutput = "{ (1 3 ) (1 4 ) (2 3 ) (2 4 ) }\n{ (3 1 ) (3 2 ) (4 1 ) (4 2 ) }\n{ }\n{ }\n{ (1776 7 4 0 ) (1776 7 4 1 ) (1776 7 14 0 ) (1776 7 14 1 ) (1776 7 23 0 ) (1776 7 23 1 ) (1776 12 4 0 ) (1776 12 4 1 ) (1776 12 14 0 ) (1776 12 14 1 ) (1776 12 23 0 ) (1776 12 23 1 ) (1789 7 4 0 ) (1789 7 4 1 ) (1789 7 14 0 ) (1789 7 14 1 ) (1789 7 23 0 ) (1789 7 23 1 ) (1789 12 4 0 ) (1789 12 4 1 ) (1789 12 14 0 ) (1789 12 14 1 ) (1789 12 23 0 ) (1789 12 23 1 ) }\n{ (1 30 500 ) (1 30 100 ) (2 30 500 ) (2 30 100 ) (3 30 500 ) (3 30 100 ) }\n{ }"; assert.strictEqual(codeOutput.language, "C++"); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + }); + + it("Sieve of Erastosthenes", async () => { + const code = `#include +#include +#include +#include + +// Fills the range [start, end) with 1 if the integer corresponding to the index is composite and 0 otherwise. +// requires: I is RandomAccessIterator +template +void mark_composites(I start, I end) +{ + std::fill(start, end, 0); + + for (auto it = start + 1; it != end; ++it) + { + if (*it == 0) + { + auto prime = std::distance(start, it) + 1; + // mark all multiples of this prime number as composite. + auto multiple_it = it; + while (std::distance(multiple_it, end) > prime) + { + std::advance(multiple_it, prime); + *multiple_it = 1; + } + } + } +} + +// Fills "out" with the prime numbers in the range 2...N where N = distance(start, end). +// requires: I is a RandomAccessIterator +// O is an OutputIterator +template +O sieve_primes(I start, I end, O out) +{ + mark_composites(start, end); + for (auto it = start + 1; it != end; ++it) + { + if (*it == 0) + { + *out = std::distance(start, it) + 1; + ++out; + } + } + return out; +} + +int main() +{ + std::vector is_composite(100); + sieve_primes(is_composite.begin(), is_composite.end(), std::ostream_iterator(std::cout, " ")); + + // Alternative to store in a vector: + // std::vector primes; + // sieve_primes(is_composite.begin(), is_composite.end(), std::back_inserter(primes)); +}`; + + const codeOutput = await pestoClient.execute({ + language: "C++", + version: "latest", + code: code + }); + + const expectedOutput = "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97"; + + assert.strictEqual(codeOutput.language, "C++"); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + }); + + it("99 Bottles", async () => { + const code = `#include +using std::cout; + +int main() +{ + for(int bottles(99); bottles > 0; bottles -= 1){ + cout << bottles << " bottles of beer on the wall, " + << bottles << " bottles of beer.\\n" + << "Take one down, pass it around, " + << bottles - 1 << " bottles of beer on the wall\\n\\n"; + } +}`; + + const codeOutput = await pestoClient.execute({ + language: "C++", + version: "latest", + code: code + }); + + const expectedOutput = "99 bottles of beer on the wall, 99 bottles of beer.\nTake one down, pass it around, 98 bottles of beer on the wall\n\n98 bottles of beer on the wall, 98 bottles of beer.\nTake one down, pass it around, 97 bottles of beer on the wall\n\n97 bottles of beer on the wall, 97 bottles of beer.\nTake one down, pass it around, 96 bottles of beer on the wall\n\n96 bottles of beer on the wall, 96 bottles of beer.\nTake one down, pass it around, 95 bottles of beer on the wall\n\n95 bottles of beer on the wall, 95 bottles of beer.\nTake one down, pass it around, 94 bottles of beer on the wall\n\n94 bottles of beer on the wall, 94 bottles of beer.\nTake one down, pass it around, 93 bottles of beer on the wall\n\n93 bottles of beer on the wall, 93 bottles of beer.\nTake one down, pass it around, 92 bottles of beer on the wall\n\n92 bottles of beer on the wall, 92 bottles of beer.\nTake one down, pass it around, 91 bottles of beer on the wall\n\n91 bottles of beer on the wall, 91 bottles of beer.\nTake one down, pass it around, 90 bottles of beer on the wall\n\n90 bottles of beer on the wall, 90 bottles of beer.\nTake one down, pass it around, 89 bottles of beer on the wall\n\n89 bottles of beer on the wall, 89 bottles of beer.\nTake one down, pass it around, 88 bottles of beer on the wall\n\n88 bottles of beer on the wall, 88 bottles of beer.\nTake one down, pass it around, 87 bottles of beer on the wall\n\n87 bottles of beer on the wall, 87 bottles of beer.\nTake one down, pass it around, 86 bottles of beer on the wall\n\n86 bottles of beer on the wall, 86 bottles of beer.\nTake one down, pass it around, 85 bottles of beer on the wall\n\n85 bottles of beer on the wall, 85 bottles of beer.\nTake one down, pass it around, 84 bottles of beer on the wall\n\n84 bottles of beer on the wall, 84 bottles of beer.\nTake one down, pass it around, 83 bottles of beer on the wall\n\n83 bottles of beer on the wall, 83 bottles of beer.\nTake one down, pass it around, 82 bottles of beer on the wall\n\n82 bottles of beer on the wall, 82 bottles of beer.\nTake one down, pass it around, 81 bottles of beer on the wall\n\n81 bottles of beer on the wall, 81 bottles of beer.\nTake one down, pass it around, 80 bottles of beer on the wall\n\n80 bottles of beer on the wall, 80 bottles of beer.\nTake one down, pass it around, 79 bottles of beer on the wall\n\n79 bottles of beer on the wall, 79 bottles of beer.\nTake one down, pass it around, 78 bottles of beer on the wall\n\n78 bottles of beer on the wall, 78 bottles of beer.\nTake one down, pass it around, 77 bottles of beer on the wall\n\n77 bottles of beer on the wall, 77 bottles of beer.\nTake one down, pass it around, 76 bottles of beer on the wall\n\n76 bottles of beer on the wall, 76 bottles of beer.\nTake one down, pass it around, 75 bottles of beer on the wall\n\n75 bottles of beer on the wall, 75 bottles of beer.\nTake one down, pass it around, 74 bottles of beer on the wall\n\n74 bottles of beer on the wall, 74 bottles of beer.\nTake one down, pass it around, 73 bottles of beer on the wall\n\n73 bottles of beer on the wall, 73 bottles of beer.\nTake one down, pass it around, 72 bottles of beer on the wall\n\n72 bottles of beer on the wall, 72 bottles of beer.\nTake one down, pass it around, 71 bottles of beer on the wall\n\n71 bottles of beer on the wall, 71 bottles of beer.\nTake one down, pass it around, 70 bottles of beer on the wall\n\n70 bottles of beer on the wall, 70 bottles of beer.\nTake one down, pass it around, 69 bottles of beer on the wall\n\n69 bottles of beer on the wall, 69 bottles of beer.\nTake one down, pass it around, 68 bottles of beer on the wall\n\n68 bottles of beer on the wall, 68 bottles of beer.\nTake one down, pass it around, 67 bottles of beer on the wall\n\n67 bottles of beer on the wall, 67 bottles of beer.\nTake one down, pass it around, 66 bottles of beer on the wall\n\n66 bottles of beer on the wall, 66 bottles of beer.\nTake one down, pass it around, 65 bottles of beer on the wall\n\n65 bottles of beer on the wall, 65 bottles of beer.\nTake one down, pass it around, 64 bottles of beer on the wall\n\n64 bottles of beer on the wall, 64 bottles of beer.\nTake one down, pass it around, 63 bottles of beer on the wall\n\n63 bottles of beer on the wall, 63 bottles of beer.\nTake one down, pass it around, 62 bottles of beer on the wall\n\n62 bottles of beer on the wall, 62 bottles of beer.\nTake one down, pass it around, 61 bottles of beer on the wall\n\n61 bottles of beer on the wall, 61 bottles of beer.\nTake one down, pass it around, 60 bottles of beer on the wall\n\n60 bottles of beer on the wall, 60 bottles of beer.\nTake one down, pass it around, 59 bottles of beer on the wall\n\n59 bottles of beer on the wall, 59 bottles of beer.\nTake one down, pass it around, 58 bottles of beer on the wall\n\n58 bottles of beer on the wall, 58 bottles of beer.\nTake one down, pass it around, 57 bottles of beer on the wall\n\n57 bottles of beer on the wall, 57 bottles of beer.\nTake one down, pass it around, 56 bottles of beer on the wall\n\n56 bottles of beer on the wall, 56 bottles of beer.\nTak"; + + assert.strictEqual(codeOutput.language, "C++"); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + }); + + it("Factorial", async () => { + const code = `#include +using std::cout; + +//iteration with while +long long int factorial(long long int n) +{ + long long int r = 1; + while(1 { + const code = `#include +#include +#include // for std::inplace_merge +#include // for std::less + +template + void mergesort(RandomAccessIterator first, RandomAccessIterator last, Order order) +{ + if (last - first > 1) + { + RandomAccessIterator middle = first + (last - first) / 2; + mergesort(first, middle, order); + mergesort(middle, last, order); + std::inplace_merge(first, middle, last, order); + } +} + +template + void mergesort(RandomAccessIterator first, RandomAccessIterator last) +{ + mergesort(first, last, std::less::value_type>()); +} + +int main() { + int array[] = {2, 8, 3, 10, 13, 6, 11, 9, 19, 15, 5, 4, 12, 14, 20, 1, 17, 18, 16, 7}; + + // Sort the array using mergesort. + mergesort(array, array + sizeof(array) / sizeof(array[0])); + + // Print the sorted array. + for (int i = 0; i < 20; i++) { + std::cout << array[i] << " "; + } + std::cout << std::endl; + + return 0; +}`; + + const codeOutput = await pestoClient.execute({ + language: "C++", + version: "latest", + code: code + }); + + const expectedOutput = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"; + + assert.strictEqual(codeOutput.language, "C++"); + assert.strictEqual(codeOutput.compile.output, ""); assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + }); + + it("Heap sort", async () => { + const code = `#include +#include +#include + +template +void heap_sort(RandomAccessIterator begin, RandomAccessIterator end) { + std::make_heap(begin, end); + std::sort_heap(begin, end); +} + +int main() { + int a[] = {2, 8, 3, 10, 13, 6, 11, 9, 19, 15, 5, 4, 12, 14, 20, 1, 17, 18, 16, 7}; + heap_sort(std::begin(a), std::end(a)); + copy(std::begin(a), std::end(a), std::ostream_iterator(std::cout, " ")); + std::cout << "\\n"; +}`; + + const codeOutput = await pestoClient.execute({ + language: "C++", + version: "latest", + code: code + }); + + const expectedOutput = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"; + + assert.strictEqual(codeOutput.language, "C++"); assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); assert.strictEqual(codeOutput.compile.stderr, ""); assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); }); -}) +}); diff --git a/dogfood/go.test.js b/dogfood/go.test.js index 800e93b..0a3111f 100644 --- a/dogfood/go.test.js +++ b/dogfood/go.test.js @@ -31,7 +31,7 @@ func main() { for i := 1; i < 100; i++ { fizzbuzz(i) } -}` +}`; const codeOutput = await pestoClient.execute({ language: "Go", @@ -50,7 +50,7 @@ func main() { assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.exitCode, 0); - }) + }); it.skip("Cartesian equation", async () => { const code = `package main @@ -95,7 +95,7 @@ func main() { assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.exitCode, 0); - }) + }); it.skip("Erdős-Nicolas numbers", async () => { const code = `package main @@ -119,7 +119,7 @@ func main() { dcount[j]++ } } -}` +}`; const codeOutput = await pestoClient.execute({ language: "Go", @@ -174,9 +174,11 @@ func heapSort(a sort.Interface) { } func main() { - a := []int{170, 45, 75, -90, -802, 24, 2, 66} + a := []int{2, 8, 3, 10, 13, 6, 11, 9, 19, 15, 5, 4, 12, 14, 20, 1, 17, 18, 16, 7} heapSort(sort.IntSlice(a)) - fmt.Println(a) + for i := 0; i < len(a); i++ { + fmt.Printf("%d ", a[i]) + } }`; const codeOutput = await pestoClient.execute({ @@ -185,16 +187,169 @@ func main() { code: code }); - const expectedOutput = "[-802 -90 2 24 45 66 75 170]" + const expectedOutput = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"; assert.strictEqual(codeOutput.language, "Go"); + assert.strictEqual(codeOutput.compile.output, ""); assert.strictEqual(codeOutput.compile.stderr, ""); assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + }); + + it.skip("Merge sort", async () => { + const code = `package main + +import "fmt" + +var a = []int{2, 8, 3, 10, 13, 6, 11, 9, 19, 15, 5, 4, 12, 14, 20, 1, 17, 18, 16, 7} +var s = make([]int, len(a)/2+1) // scratch space for merge step + +func main() { + mergeSort(a) + for i := 0; i < len(a); i++ { + fmt.Printf("%d ", a[i]) + } +} + +func mergeSort(a []int) { + if len(a) < 2 { + return + } + mid := len(a) / 2 + mergeSort(a[:mid]) + mergeSort(a[mid:]) + if a[mid-1] <= a[mid] { + return + } + // merge step, with the copy-half optimization + copy(s, a[:mid]) + l, r := 0, mid + for i := 0; ; i++ { + if s[l] <= a[r] { + a[i] = s[l] + l++ + if l == mid { + break + } + } else { + a[i] = a[r] + r++ + if r == len(a) { + copy(a[i+1:], s[l:mid]) + break + } + } + } + return +}`; + + const codeOutput = await pestoClient.execute({ + language: "Go", + version: "latest", + code: code + }); + + const expectedOutput = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"; + + assert.strictEqual(codeOutput.language, "Go"); assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + }); + + it.skip("99 Bottles", async () => { + const code = `package main + +import "fmt" + +func main() { + bottles := func(i int) string { + switch i { + case 0: + return "No more bottles" + case 1: + return "1 bottle" + default: + return fmt.Sprintf("%d bottles", i) + } + } + + for i := 99; i > 0; i-- { + fmt.Printf("%s of beer on the wall, ", bottles(i)) + fmt.Printf("%s of beer.\\n", bottles(i)) + fmt.Printf("Take one down, pass it around,") + fmt.Printf("%s of beer on the wall\\n\\n", bottles(i-1)) + } +}`; + + const codeOutput = await pestoClient.execute({ + language: "Go", + version: "latest", + code: code + }); + + const expectedOutput = "99 bottles of beer on the wall, 99 bottles of beer.\nTake one down, pass it around, 98 bottles of beer on the wall\n\n98 bottles of beer on the wall, 98 bottles of beer.\nTake one down, pass it around, 97 bottles of beer on the wall\n\n97 bottles of beer on the wall, 97 bottles of beer.\nTake one down, pass it around, 96 bottles of beer on the wall\n\n96 bottles of beer on the wall, 96 bottles of beer.\nTake one down, pass it around, 95 bottles of beer on the wall\n\n95 bottles of beer on the wall, 95 bottles of beer.\nTake one down, pass it around, 94 bottles of beer on the wall\n\n94 bottles of beer on the wall, 94 bottles of beer.\nTake one down, pass it around, 93 bottles of beer on the wall\n\n93 bottles of beer on the wall, 93 bottles of beer.\nTake one down, pass it around, 92 bottles of beer on the wall\n\n92 bottles of beer on the wall, 92 bottles of beer.\nTake one down, pass it around, 91 bottles of beer on the wall\n\n91 bottles of beer on the wall, 91 bottles of beer.\nTake one down, pass it around, 90 bottles of beer on the wall\n\n90 bottles of beer on the wall, 90 bottles of beer.\nTake one down, pass it around, 89 bottles of beer on the wall\n\n89 bottles of beer on the wall, 89 bottles of beer.\nTake one down, pass it around, 88 bottles of beer on the wall\n\n88 bottles of beer on the wall, 88 bottles of beer.\nTake one down, pass it around, 87 bottles of beer on the wall\n\n87 bottles of beer on the wall, 87 bottles of beer.\nTake one down, pass it around, 86 bottles of beer on the wall\n\n86 bottles of beer on the wall, 86 bottles of beer.\nTake one down, pass it around, 85 bottles of beer on the wall\n\n85 bottles of beer on the wall, 85 bottles of beer.\nTake one down, pass it around, 84 bottles of beer on the wall\n\n84 bottles of beer on the wall, 84 bottles of beer.\nTake one down, pass it around, 83 bottles of beer on the wall\n\n83 bottles of beer on the wall, 83 bottles of beer.\nTake one down, pass it around, 82 bottles of beer on the wall\n\n82 bottles of beer on the wall, 82 bottles of beer.\nTake one down, pass it around, 81 bottles of beer on the wall\n\n81 bottles of beer on the wall, 81 bottles of beer.\nTake one down, pass it around, 80 bottles of beer on the wall\n\n80 bottles of beer on the wall, 80 bottles of beer.\nTake one down, pass it around, 79 bottles of beer on the wall\n\n79 bottles of beer on the wall, 79 bottles of beer.\nTake one down, pass it around, 78 bottles of beer on the wall\n\n78 bottles of beer on the wall, 78 bottles of beer.\nTake one down, pass it around, 77 bottles of beer on the wall\n\n77 bottles of beer on the wall, 77 bottles of beer.\nTake one down, pass it around, 76 bottles of beer on the wall\n\n76 bottles of beer on the wall, 76 bottles of beer.\nTake one down, pass it around, 75 bottles of beer on the wall\n\n75 bottles of beer on the wall, 75 bottles of beer.\nTake one down, pass it around, 74 bottles of beer on the wall\n\n74 bottles of beer on the wall, 74 bottles of beer.\nTake one down, pass it around, 73 bottles of beer on the wall\n\n73 bottles of beer on the wall, 73 bottles of beer.\nTake one down, pass it around, 72 bottles of beer on the wall\n\n72 bottles of beer on the wall, 72 bottles of beer.\nTake one down, pass it around, 71 bottles of beer on the wall\n\n71 bottles of beer on the wall, 71 bottles of beer.\nTake one down, pass it around, 70 bottles of beer on the wall\n\n70 bottles of beer on the wall, 70 bottles of beer.\nTake one down, pass it around, 69 bottles of beer on the wall\n\n69 bottles of beer on the wall, 69 bottles of beer.\nTake one down, pass it around, 68 bottles of beer on the wall\n\n68 bottles of beer on the wall, 68 bottles of beer.\nTake one down, pass it around, 67 bottles of beer on the wall\n\n67 bottles of beer on the wall, 67 bottles of beer.\nTake one down, pass it around, 66 bottles of beer on the wall\n\n66 bottles of beer on the wall, 66 bottles of beer.\nTake one down, pass it around, 65 bottles of beer on the wall\n\n65 bottles of beer on the wall, 65 bottles of beer.\nTake one down, pass it around, 64 bottles of beer on the wall\n\n64 bottles of beer on the wall, 64 bottles of beer.\nTake one down, pass it around, 63 bottles of beer on the wall\n\n63 bottles of beer on the wall, 63 bottles of beer.\nTake one down, pass it around, 62 bottles of beer on the wall\n\n62 bottles of beer on the wall, 62 bottles of beer.\nTake one down, pass it around, 61 bottles of beer on the wall\n\n61 bottles of beer on the wall, 61 bottles of beer.\nTake one down, pass it around, 60 bottles of beer on the wall\n\n60 bottles of beer on the wall, 60 bottles of beer.\nTake one down, pass it around, 59 bottles of beer on the wall\n\n59 bottles of beer on the wall, 59 bottles of beer.\nTake one down, pass it around, 58 bottles of beer on the wall\n\n58 bottles of beer on the wall, 58 bottles of beer.\nTake one down, pass it around, 57 bottles of beer on the wall\n\n57 bottles of beer on the wall, 57 bottles of beer.\nTake one down, pass it around, 56 bottles of beer on the wall\n\n56 bottles of beer on the wall, 56 bottles of beer.\nTak"; + + assert.strictEqual(codeOutput.language, "Go"); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + }); + + it.skip("Factorial", async () => { + const code = `package main + +import ( + "fmt" + "math/big" +) + +func main() { + fmt.Println(factorial(10)) +} + +func factorial(n int64) *big.Int { + if n < 0 { + return nil + } + r := big.NewInt(1) + var f big.Int + for i := int64(2); i <= n; i++ { + r.Mul(r, f.SetInt64(i)) + } + return r +}`; + + const codeOutput = await pestoClient.execute({ + language: "Go", + version: "latest", + code: code + }); + + const expectedOutput = "3628800"; + + assert.strictEqual(codeOutput.language, "Go"); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); assert.strictEqual(codeOutput.runtime.exitCode, 0); }); -}) +}); diff --git a/dogfood/javascript.test.js b/dogfood/javascript.test.js index a8d7abb..56d5048 100644 --- a/dogfood/javascript.test.js +++ b/dogfood/javascript.test.js @@ -70,12 +70,12 @@ describe("Javascript", {concurrency: true}, () => { it("FizzBuzz", async () => { const code = `let i, output; - for (i = 1; i < 101; i += 1) { - output = ''; - if (!(i % 3)) { output += 'Fizz'; } - if (!(i % 5)) { output += 'Buzz'; } - console.log(output || i); - }`; +for (i = 1; i < 101; i += 1) { + output = ''; + if (!(i % 3)) { output += 'Fizz'; } + if (!(i % 5)) { output += 'Buzz'; } + console.log(output || i); +}`; const codeOutput = await pestoClient.execute({ language: "Javascript", @@ -86,13 +86,231 @@ describe("Javascript", {concurrency: true}, () => { const expectedOutput = "1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n11\nFizz\n13\n14\nFizzBuzz\n16\n17\nFizz\n19\nBuzz\nFizz\n22\n23\nFizz\nBuzz\n26\nFizz\n28\n29\nFizzBuzz\n31\n32\nFizz\n34\nBuzz\nFizz\n37\n38\nFizz\nBuzz\n41\nFizz\n43\n44\nFizzBuzz\n46\n47\nFizz\n49\nBuzz\nFizz\n52\n53\nFizz\nBuzz\n56\nFizz\n58\n59\nFizzBuzz\n61\n62\nFizz\n64\nBuzz\nFizz\n67\n68\nFizz\nBuzz\n71\nFizz\n73\n74\nFizzBuzz\n76\n77\nFizz\n79\nBuzz\nFizz\n82\n83\nFizz\nBuzz\n86\nFizz\n88\n89\nFizzBuzz\n91\n92\nFizz\n94\nBuzz\nFizz\n97\n98\nFizz\nBuzz"; assert.strictEqual(codeOutput.language, "Javascript"); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + }); + + it("Sieve of Erastosthenes", async () => { + const code = `function eratosthenes(limit) { + var primes = []; + if (limit >= 2) { + var sqrtlmt = Math.sqrt(limit) - 2; + var nums = new Array(); // start with an empty Array... + for (var i = 2; i <= limit; i++) // and + nums.push(i); // only initialize the Array once... + for (var i = 0; i <= sqrtlmt; i++) { + var p = nums[i] + if (p) + for (var j = p * p - 2; j < nums.length; j += p) + nums[j] = 0; + } + for (var i = 0; i < nums.length; i++) { + var p = nums[i]; + if (p) + primes.push(p); + } + } + return primes; +} + +var primes = eratosthenes(100); + +console.log(primes.join(" "));`; + + const codeOutput = await pestoClient.execute({ + language: "Javascript", + version: "latest", + code: code + }); + + const expectedOutput = "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97"; + + assert.strictEqual(codeOutput.language, "Javascript"); + assert.strictEqual(codeOutput.runtime.exitCode, 0); assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + }); + + it("99 Bottles", async () => { + const code = `let beer = 99; +while (beer > 0) { + let verse = \`\${beer} bottles of beer on the wall, \${beer} bottles of beer.\\n\` + + \`Take one down, pass it around, \${beer-1} bottles of beer on the wall\\n\`; + + console.log(verse); + beer--; +}`; + + const codeOutput = await pestoClient.execute({ + language: "Javascript", + version: "latest", + code: code + }); + + const expectedOutput = "99 bottles of beer on the wall, 99 bottles of beer.\nTake one down, pass it around, 98 bottles of beer on the wall\n\n98 bottles of beer on the wall, 98 bottles of beer.\nTake one down, pass it around, 97 bottles of beer on the wall\n\n97 bottles of beer on the wall, 97 bottles of beer.\nTake one down, pass it around, 96 bottles of beer on the wall\n\n96 bottles of beer on the wall, 96 bottles of beer.\nTake one down, pass it around, 95 bottles of beer on the wall\n\n95 bottles of beer on the wall, 95 bottles of beer.\nTake one down, pass it around, 94 bottles of beer on the wall\n\n94 bottles of beer on the wall, 94 bottles of beer.\nTake one down, pass it around, 93 bottles of beer on the wall\n\n93 bottles of beer on the wall, 93 bottles of beer.\nTake one down, pass it around, 92 bottles of beer on the wall\n\n92 bottles of beer on the wall, 92 bottles of beer.\nTake one down, pass it around, 91 bottles of beer on the wall\n\n91 bottles of beer on the wall, 91 bottles of beer.\nTake one down, pass it around, 90 bottles of beer on the wall\n\n90 bottles of beer on the wall, 90 bottles of beer.\nTake one down, pass it around, 89 bottles of beer on the wall\n\n89 bottles of beer on the wall, 89 bottles of beer.\nTake one down, pass it around, 88 bottles of beer on the wall\n\n88 bottles of beer on the wall, 88 bottles of beer.\nTake one down, pass it around, 87 bottles of beer on the wall\n\n87 bottles of beer on the wall, 87 bottles of beer.\nTake one down, pass it around, 86 bottles of beer on the wall\n\n86 bottles of beer on the wall, 86 bottles of beer.\nTake one down, pass it around, 85 bottles of beer on the wall\n\n85 bottles of beer on the wall, 85 bottles of beer.\nTake one down, pass it around, 84 bottles of beer on the wall\n\n84 bottles of beer on the wall, 84 bottles of beer.\nTake one down, pass it around, 83 bottles of beer on the wall\n\n83 bottles of beer on the wall, 83 bottles of beer.\nTake one down, pass it around, 82 bottles of beer on the wall\n\n82 bottles of beer on the wall, 82 bottles of beer.\nTake one down, pass it around, 81 bottles of beer on the wall\n\n81 bottles of beer on the wall, 81 bottles of beer.\nTake one down, pass it around, 80 bottles of beer on the wall\n\n80 bottles of beer on the wall, 80 bottles of beer.\nTake one down, pass it around, 79 bottles of beer on the wall\n\n79 bottles of beer on the wall, 79 bottles of beer.\nTake one down, pass it around, 78 bottles of beer on the wall\n\n78 bottles of beer on the wall, 78 bottles of beer.\nTake one down, pass it around, 77 bottles of beer on the wall\n\n77 bottles of beer on the wall, 77 bottles of beer.\nTake one down, pass it around, 76 bottles of beer on the wall\n\n76 bottles of beer on the wall, 76 bottles of beer.\nTake one down, pass it around, 75 bottles of beer on the wall\n\n75 bottles of beer on the wall, 75 bottles of beer.\nTake one down, pass it around, 74 bottles of beer on the wall\n\n74 bottles of beer on the wall, 74 bottles of beer.\nTake one down, pass it around, 73 bottles of beer on the wall\n\n73 bottles of beer on the wall, 73 bottles of beer.\nTake one down, pass it around, 72 bottles of beer on the wall\n\n72 bottles of beer on the wall, 72 bottles of beer.\nTake one down, pass it around, 71 bottles of beer on the wall\n\n71 bottles of beer on the wall, 71 bottles of beer.\nTake one down, pass it around, 70 bottles of beer on the wall\n\n70 bottles of beer on the wall, 70 bottles of beer.\nTake one down, pass it around, 69 bottles of beer on the wall\n\n69 bottles of beer on the wall, 69 bottles of beer.\nTake one down, pass it around, 68 bottles of beer on the wall\n\n68 bottles of beer on the wall, 68 bottles of beer.\nTake one down, pass it around, 67 bottles of beer on the wall\n\n67 bottles of beer on the wall, 67 bottles of beer.\nTake one down, pass it around, 66 bottles of beer on the wall\n\n66 bottles of beer on the wall, 66 bottles of beer.\nTake one down, pass it around, 65 bottles of beer on the wall\n\n65 bottles of beer on the wall, 65 bottles of beer.\nTake one down, pass it around, 64 bottles of beer on the wall\n\n64 bottles of beer on the wall, 64 bottles of beer.\nTake one down, pass it around, 63 bottles of beer on the wall\n\n63 bottles of beer on the wall, 63 bottles of beer.\nTake one down, pass it around, 62 bottles of beer on the wall\n\n62 bottles of beer on the wall, 62 bottles of beer.\nTake one down, pass it around, 61 bottles of beer on the wall\n\n61 bottles of beer on the wall, 61 bottles of beer.\nTake one down, pass it around, 60 bottles of beer on the wall\n\n60 bottles of beer on the wall, 60 bottles of beer.\nTake one down, pass it around, 59 bottles of beer on the wall\n\n59 bottles of beer on the wall, 59 bottles of beer.\nTake one down, pass it around, 58 bottles of beer on the wall\n\n58 bottles of beer on the wall, 58 bottles of beer.\nTake one down, pass it around, 57 bottles of beer on the wall\n\n57 bottles of beer on the wall, 57 bottles of beer.\nTake one down, pass it around, 56 bottles of beer on the wall\n\n56 bottles of beer on the wall, 56 bottles of beer.\nTak"; + + assert.strictEqual(codeOutput.language, "Javascript"); assert.strictEqual(codeOutput.runtime.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.compile.output, ""); assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + }); + + it("Factorial", async () => { + const code = `function factorial(n) { + //check our edge case + if (n < 0) { throw "Number must be non-negative"; } + + var result = 1; + //we skip zero and one since both are 1 and are identity + while (n > 1) { + result *= n; + n--; + } + return result; +} + +console.log(factorial(10));`; + + const codeOutput = await pestoClient.execute({ + language: "Javascript", + version: "latest", + code: code + }); + + const expectedOutput = "3628800"; + + assert.strictEqual(codeOutput.language, "Javascript"); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); assert.strictEqual(codeOutput.compile.stderr, ""); + }); + + it("Merge sort", async () => { + const code = `function mergeSort(v) { + if (v.length <= 1) { + return v; + } + + let m = Math.floor(v.length / 2); + let l = mergeSort(v.slice(0, m)); + let r = mergeSort(v.slice(m)); + return merge(l, r); + + function merge(a, b) { + let i = 0, j = 0; + let n = a.length + b.length; + let c = []; + while (c.length < n) { + if (i < a.length && (j >= b.length || a[i] < b[j])) { + c.push(a[i++]); + } else { + c.push(b[j++]); + } + } + return c; + } +} + +console.log(mergeSort([2, 8, 3, 10, 13, 6, 11, 9, 19, 15, 5, 4, 12, 14, 20, 1, 17, 18, 16, 7]).join(" "));`; + + + const codeOutput = await pestoClient.execute({ + language: "Javascript", + version: "latest", + code: code + }); + + const expectedOutput = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"; + + assert.strictEqual(codeOutput.language, "Javascript"); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); assert.strictEqual(codeOutput.compile.exitCode, 0); - }) -}) + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + }); + + it("Heap sort", async () => { + const code = `function heapSort(arr) { + heapify(arr) + end = arr.length - 1 + while (end > 0) { + [arr[end], arr[0]] = [arr[0], arr[end]] + end-- + siftDown(arr, 0, end) + } +} + +function heapify(arr) { + start = Math.floor(arr.length/2) - 1 + + while (start >= 0) { + siftDown(arr, start, arr.length - 1) + start-- + } +} + +function siftDown(arr, startPos, endPos) { + let rootPos = startPos + + while (rootPos * 2 + 1 <= endPos) { + childPos = rootPos * 2 + 1 + if (childPos + 1 <= endPos && arr[childPos] < arr[childPos + 1]) { + childPos++ + } + if (arr[rootPos] < arr[childPos]) { + [arr[rootPos], arr[childPos]] = [arr[childPos], arr[rootPos]] + rootPos = childPos + } else { + return + } + } +} + +const arr = [2, 8, 3, 10, 13, 6, 11, 9, 19, 15, 5, 4, 12, 14, 20, 1, 17, 18, 16, 7]; +heapSort(arr); +console.log(arr.join(" "));`; + + const codeOutput = await pestoClient.execute({ + language: "Javascript", + version: "latest", + code: code + }); + + const expectedOutput = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"; + + assert.strictEqual(codeOutput.language, "Javascript"); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + }); +}); diff --git a/dogfood/julia.test.js b/dogfood/julia.test.js index 5ab745d..cefc6fa 100644 --- a/dogfood/julia.test.js +++ b/dogfood/julia.test.js @@ -28,7 +28,7 @@ end`; const codeOutput = await pestoClient.execute({ language: "Julia", version: "latest", - code, + code }); const expectedOutput = "1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n11\nFizz\n13\n14\nFizzBuzz\n16\n17\nFizz\n19\nBuzz\nFizz\n22\n23\nFizz\nBuzz\n26\nFizz\n28\n29\nFizzBuzz\n31\n32\nFizz\n34\nBuzz\nFizz\n37\n38\nFizz\nBuzz\n41\nFizz\n43\n44\nFizzBuzz\n46\n47\nFizz\n49\nBuzz\nFizz\n52\n53\nFizz\nBuzz\n56\nFizz\n58\n59\nFizzBuzz\n61\n62\nFizz\n64\nBuzz\nFizz\n67\n68\nFizz\nBuzz\n71\nFizz\n73\n74\nFizzBuzz\n76\n77\nFizz\n79\nBuzz\nFizz\n82\n83\nFizz\nBuzz\n86\nFizz\n88\n89\nFizzBuzz\n91\n92\nFizz\n94\nBuzz\nFizz\n97\n98\nFizz\nBuzz"; @@ -77,20 +77,20 @@ print(csrcipher(text, key))`; const codeOutput = await pestoClient.execute({ language: "Julia", version: "latest", - code, + code }); - const expectedOutput = "Zntvp Rapelcgvba" + const expectedOutput = "Zntvp Rapelcgvba"; assert.strictEqual(codeOutput.language, "Julia"); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + assert.strictEqual(codeOutput.compile.output, ""); assert.strictEqual(codeOutput.compile.stderr, ""); assert.strictEqual(codeOutput.compile.stdout, ""); - assert.strictEqual(codeOutput.compile.output, ""); assert.strictEqual(codeOutput.compile.exitCode, 0); - assert.strictEqual(codeOutput.runtime.stderr, ""); - assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); - assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); - assert.strictEqual(codeOutput.runtime.exitCode, 0); }); it("Heap sort", async () => { @@ -132,52 +132,211 @@ function heapsort!(a) return a end -using Random: shuffle -a = shuffle(collect(1:12)) -println(heapsort!(a))`; +a = [2, 8, 3, 10, 13, 6, 11, 9, 19, 15, 5, 4, 12, 14, 20, 1, 17, 18, 16, 7] +heapsort!(a) +for i = 1:length(a) + print(a[i], " ") +end`; const codeOutput = await pestoClient.execute({ language: "Julia", version: "latest", - code, + code }); - const expectedOutput = "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]"; + const expectedOutput = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"; assert.strictEqual(codeOutput.language, "Julia"); - assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.stderr, ""); assert.strictEqual(codeOutput.runtime.exitCode, 0); - assert.strictEqual(codeOutput.compile.stdout, ""); assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); assert.strictEqual(codeOutput.compile.stderr, ""); assert.strictEqual(codeOutput.compile.exitCode, 0); }); - it("Polynomial regression", async () => { - const code = `polyfit(x::Vector, y::Vector, deg::Int) = collect(v ^ p for v in x, p in 0:deg) \\ y + it("Merge sort", async () => { + // Solution by cbk on Jan 12, 2022: https://stackoverflow.com/a/70674990/3153224 + const code = `# Top-level function will allocate temporary arrays for convenience +function mergesort(A) + S = similar(A) + return mergesort!(copy(A), S) +end + +# Efficient in-place version +# S is a temporary working (scratch) array +function mergesort!(A, S, n=length(A)) + width = 1 + swapcount = 0 + while width < n + # A is currently full of sorted runs of length 'width' (starting with width=1) + for i = 1:2*width:n + # Merge two sorted lists, left and right: + # left = A[i:i+width-1], right = A[i+width:i+2*width-1] + merge!(A, i, min(i+width, n+1), min(i+2*width, n+1), S) + end + # Swap the pointers of 'A' and 'S' such that 'A' now contains merged + # runs of length 2*width. + S,A = A,S + swapcount += 1 + + # Double the width and continue + width *= 2 + end + # Optional, if it is important that 'A' be sorted in-place: + if isodd(swapcount) + # If we've swapped A and S an odd number of times, copy 'A' back to 'S' + # since 'S' will by now refer to the memory initially provided as input + # array 'A', which the user will expect to have been sorted in-place + copyto!(S,A) + end + return A +end + +# Merge two sorted subarrays, left and right: +# left = A[iₗ:iᵣ-1], right = A[iᵣ:iₑ-1] +@inline function merge!(A, iₗ, iᵣ, iₑ, S) + left, right = iₗ, iᵣ + @inbounds for n = iₗ:(iₑ-1) + if (left < iᵣ) && (right >= iₑ || A[left] <= A[right]) + S[n] = A[left] + left += 1 + else + S[n] = A[right] + right += 1 + end + end +end -x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] -y = [1, 6, 17, 34, 57, 86, 121, 162, 209, 262, 321] -@show polyfit(x, y, 2)`; +v = [2, 8, 3, 10, 13, 6, 11, 9, 19, 15, 5, 4, 12, 14, 20, 1, 17, 18, 16, 7] +sorted = mergesort(v) +for i = 1:length(sorted) + print(sorted[i], " ") +end`; const codeOutput = await pestoClient.execute({ language: "Julia", version: "latest", - code, + code }); - const expectedOutput = "polyfit(x, y, 2) = [0.9999999999999526, 2.0000000000000164, 2.9999999999999982]"; + const expectedOutput = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"; assert.strictEqual(codeOutput.language, "Julia"); - assert.strictEqual(codeOutput.compile.exitCode, 0); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); assert.strictEqual(codeOutput.compile.output, ""); - assert.strictEqual(codeOutput.compile.stderr, ""); assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + }); + + it("Sieve of Erastosthenes", async () => { + const code = `function sieve(lim :: Int) + if lim < 2 return [] end + limi :: Int = (lim - 1) ÷ 2 # calculate the required array size + isprime :: Array{Bool} = trues(limi) + llimi :: Int = (isqrt(lim) - 1) ÷ 2 # and calculate maximum root prime index + result :: Array{Int} = [2] #Initial array + for i in 1:limi + if isprime[i] + p = i + i + 1 # 2i + 1 + if i <= llimi + for j = (p*p-1)>>>1:p:limi # quick shift/divide in case LLVM doesn't optimize divide by 2 away + isprime[j] = false + end + end + push!(result, p) + end + end + return result +end + +println(sieve(100))`; + + const codeOutput = await pestoClient.execute({ + language: "Julia", + version: "latest", + code + }); + + const expectedOutput = "[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]"; + + assert.strictEqual(codeOutput.language, "Julia"); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + }); + + it("99 Bottles", async () => { + const code = `i = 99 +while i > 0 + println("$i bottles of beer on the wall, $i bottles of beer.") + println("Take one down, pass it around, $(i-1) bottles of beer on the wall\\n") + global i -= 1 +end`; + + const codeOutput = await pestoClient.execute({ + language: "Julia", + version: "latest", + code + }); + + const expectedOutput = "99 bottles of beer on the wall, 99 bottles of beer.\nTake one down, pass it around, 98 bottles of beer on the wall\n\n98 bottles of beer on the wall, 98 bottles of beer.\nTake one down, pass it around, 97 bottles of beer on the wall\n\n97 bottles of beer on the wall, 97 bottles of beer.\nTake one down, pass it around, 96 bottles of beer on the wall\n\n96 bottles of beer on the wall, 96 bottles of beer.\nTake one down, pass it around, 95 bottles of beer on the wall\n\n95 bottles of beer on the wall, 95 bottles of beer.\nTake one down, pass it around, 94 bottles of beer on the wall\n\n94 bottles of beer on the wall, 94 bottles of beer.\nTake one down, pass it around, 93 bottles of beer on the wall\n\n93 bottles of beer on the wall, 93 bottles of beer.\nTake one down, pass it around, 92 bottles of beer on the wall\n\n92 bottles of beer on the wall, 92 bottles of beer.\nTake one down, pass it around, 91 bottles of beer on the wall\n\n91 bottles of beer on the wall, 91 bottles of beer.\nTake one down, pass it around, 90 bottles of beer on the wall\n\n90 bottles of beer on the wall, 90 bottles of beer.\nTake one down, pass it around, 89 bottles of beer on the wall\n\n89 bottles of beer on the wall, 89 bottles of beer.\nTake one down, pass it around, 88 bottles of beer on the wall\n\n88 bottles of beer on the wall, 88 bottles of beer.\nTake one down, pass it around, 87 bottles of beer on the wall\n\n87 bottles of beer on the wall, 87 bottles of beer.\nTake one down, pass it around, 86 bottles of beer on the wall\n\n86 bottles of beer on the wall, 86 bottles of beer.\nTake one down, pass it around, 85 bottles of beer on the wall\n\n85 bottles of beer on the wall, 85 bottles of beer.\nTake one down, pass it around, 84 bottles of beer on the wall\n\n84 bottles of beer on the wall, 84 bottles of beer.\nTake one down, pass it around, 83 bottles of beer on the wall\n\n83 bottles of beer on the wall, 83 bottles of beer.\nTake one down, pass it around, 82 bottles of beer on the wall\n\n82 bottles of beer on the wall, 82 bottles of beer.\nTake one down, pass it around, 81 bottles of beer on the wall\n\n81 bottles of beer on the wall, 81 bottles of beer.\nTake one down, pass it around, 80 bottles of beer on the wall\n\n80 bottles of beer on the wall, 80 bottles of beer.\nTake one down, pass it around, 79 bottles of beer on the wall\n\n79 bottles of beer on the wall, 79 bottles of beer.\nTake one down, pass it around, 78 bottles of beer on the wall\n\n78 bottles of beer on the wall, 78 bottles of beer.\nTake one down, pass it around, 77 bottles of beer on the wall\n\n77 bottles of beer on the wall, 77 bottles of beer.\nTake one down, pass it around, 76 bottles of beer on the wall\n\n76 bottles of beer on the wall, 76 bottles of beer.\nTake one down, pass it around, 75 bottles of beer on the wall\n\n75 bottles of beer on the wall, 75 bottles of beer.\nTake one down, pass it around, 74 bottles of beer on the wall\n\n74 bottles of beer on the wall, 74 bottles of beer.\nTake one down, pass it around, 73 bottles of beer on the wall\n\n73 bottles of beer on the wall, 73 bottles of beer.\nTake one down, pass it around, 72 bottles of beer on the wall\n\n72 bottles of beer on the wall, 72 bottles of beer.\nTake one down, pass it around, 71 bottles of beer on the wall\n\n71 bottles of beer on the wall, 71 bottles of beer.\nTake one down, pass it around, 70 bottles of beer on the wall\n\n70 bottles of beer on the wall, 70 bottles of beer.\nTake one down, pass it around, 69 bottles of beer on the wall\n\n69 bottles of beer on the wall, 69 bottles of beer.\nTake one down, pass it around, 68 bottles of beer on the wall\n\n68 bottles of beer on the wall, 68 bottles of beer.\nTake one down, pass it around, 67 bottles of beer on the wall\n\n67 bottles of beer on the wall, 67 bottles of beer.\nTake one down, pass it around, 66 bottles of beer on the wall\n\n66 bottles of beer on the wall, 66 bottles of beer.\nTake one down, pass it around, 65 bottles of beer on the wall\n\n65 bottles of beer on the wall, 65 bottles of beer.\nTake one down, pass it around, 64 bottles of beer on the wall\n\n64 bottles of beer on the wall, 64 bottles of beer.\nTake one down, pass it around, 63 bottles of beer on the wall\n\n63 bottles of beer on the wall, 63 bottles of beer.\nTake one down, pass it around, 62 bottles of beer on the wall\n\n62 bottles of beer on the wall, 62 bottles of beer.\nTake one down, pass it around, 61 bottles of beer on the wall\n\n61 bottles of beer on the wall, 61 bottles of beer.\nTake one down, pass it around, 60 bottles of beer on the wall\n\n60 bottles of beer on the wall, 60 bottles of beer.\nTake one down, pass it around, 59 bottles of beer on the wall\n\n59 bottles of beer on the wall, 59 bottles of beer.\nTake one down, pass it around, 58 bottles of beer on the wall\n\n58 bottles of beer on the wall, 58 bottles of beer.\nTake one down, pass it around, 57 bottles of beer on the wall\n\n57 bottles of beer on the wall, 57 bottles of beer.\nTake one down, pass it around, 56 bottles of beer on the wall\n\n56 bottles of beer on the wall, 56 bottles of beer.\nTak"; + + assert.strictEqual(codeOutput.language, "Julia"); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + }); + + it("Factorial", async () => { + const code = `function factorial(n::Int64) + if n < 0 + throw(ArgumentError("Number must be non-negative")) + end + + result = 1 + while n > 1 + result *= n + n -= 1 + end + + return result +end + +println(factorial(10))`; + + const codeOutput = await pestoClient.execute({ + language: "Julia", + version: "latest", + code + }); + + const expectedOutput = "3628800"; + + assert.strictEqual(codeOutput.language, "Julia"); assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); assert.strictEqual(codeOutput.runtime.exitCode, 0); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); }); -}) +}); diff --git a/dogfood/lua.test.js b/dogfood/lua.test.js index 07c1709..2cf6b35 100644 --- a/dogfood/lua.test.js +++ b/dogfood/lua.test.js @@ -90,7 +90,7 @@ describe("Lua", {concurrency: true}, () => { local text = "The quick brown fox jumped over the lazy dogs" local encrypted = caesar.encrypt(text, 11) print(encrypted) - end` + end`; const codeOutput = await pestoClient.execute({ language: "Lua", @@ -109,5 +109,92 @@ describe("Lua", {concurrency: true}, () => { assert.strictEqual(codeOutput.compile.output, ""); assert.strictEqual(codeOutput.compile.stderr, ""); assert.strictEqual(codeOutput.compile.exitCode, 0); - }) -}) + }); + + it("Sieve of Erastosthenes", async () => { + const code = `function erato(n) + if n < 2 then return {} end + local t = {0} -- clears '1' + local sqrtlmt = math.sqrt(n) + for i = 2, n do t[i] = 1 end + for i = 2, sqrtlmt do if t[i] ~= 0 then for j = i*i, n, i do t[j] = 0 end end end + local primes = {} + for i = 2, n do if t[i] ~= 0 then table.insert(primes, i) end end + return primes +end + +print(table.concat(erato(100), " "))`; + + const codeOutput = await pestoClient.execute({ + language: "Lua", + version: "latest", + code: code + }); + + const expectedOutput = "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97"; + + assert.strictEqual(codeOutput.language, "Lua"); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + }); + + it("99 Bottles", async () => { + const code = `verse = [[%i bottles of beer on the wall, %i bottles of beer. +Take one down, pass it around, %i bottles of beer on the wall +]] + +for i = 99, 1, -1 do + print(verse:format(i, i, i-1)) +end`; + + const codeOutput = await pestoClient.execute({ + language: "Lua", + version: "latest", + code: code + }); + + const expectedOutput = "99 bottles of beer on the wall, 99 bottles of beer.\nTake one down, pass it around, 98 bottles of beer on the wall\n\n98 bottles of beer on the wall, 98 bottles of beer.\nTake one down, pass it around, 97 bottles of beer on the wall\n\n97 bottles of beer on the wall, 97 bottles of beer.\nTake one down, pass it around, 96 bottles of beer on the wall\n\n96 bottles of beer on the wall, 96 bottles of beer.\nTake one down, pass it around, 95 bottles of beer on the wall\n\n95 bottles of beer on the wall, 95 bottles of beer.\nTake one down, pass it around, 94 bottles of beer on the wall\n\n94 bottles of beer on the wall, 94 bottles of beer.\nTake one down, pass it around, 93 bottles of beer on the wall\n\n93 bottles of beer on the wall, 93 bottles of beer.\nTake one down, pass it around, 92 bottles of beer on the wall\n\n92 bottles of beer on the wall, 92 bottles of beer.\nTake one down, pass it around, 91 bottles of beer on the wall\n\n91 bottles of beer on the wall, 91 bottles of beer.\nTake one down, pass it around, 90 bottles of beer on the wall\n\n90 bottles of beer on the wall, 90 bottles of beer.\nTake one down, pass it around, 89 bottles of beer on the wall\n\n89 bottles of beer on the wall, 89 bottles of beer.\nTake one down, pass it around, 88 bottles of beer on the wall\n\n88 bottles of beer on the wall, 88 bottles of beer.\nTake one down, pass it around, 87 bottles of beer on the wall\n\n87 bottles of beer on the wall, 87 bottles of beer.\nTake one down, pass it around, 86 bottles of beer on the wall\n\n86 bottles of beer on the wall, 86 bottles of beer.\nTake one down, pass it around, 85 bottles of beer on the wall\n\n85 bottles of beer on the wall, 85 bottles of beer.\nTake one down, pass it around, 84 bottles of beer on the wall\n\n84 bottles of beer on the wall, 84 bottles of beer.\nTake one down, pass it around, 83 bottles of beer on the wall\n\n83 bottles of beer on the wall, 83 bottles of beer.\nTake one down, pass it around, 82 bottles of beer on the wall\n\n82 bottles of beer on the wall, 82 bottles of beer.\nTake one down, pass it around, 81 bottles of beer on the wall\n\n81 bottles of beer on the wall, 81 bottles of beer.\nTake one down, pass it around, 80 bottles of beer on the wall\n\n80 bottles of beer on the wall, 80 bottles of beer.\nTake one down, pass it around, 79 bottles of beer on the wall\n\n79 bottles of beer on the wall, 79 bottles of beer.\nTake one down, pass it around, 78 bottles of beer on the wall\n\n78 bottles of beer on the wall, 78 bottles of beer.\nTake one down, pass it around, 77 bottles of beer on the wall\n\n77 bottles of beer on the wall, 77 bottles of beer.\nTake one down, pass it around, 76 bottles of beer on the wall\n\n76 bottles of beer on the wall, 76 bottles of beer.\nTake one down, pass it around, 75 bottles of beer on the wall\n\n75 bottles of beer on the wall, 75 bottles of beer.\nTake one down, pass it around, 74 bottles of beer on the wall\n\n74 bottles of beer on the wall, 74 bottles of beer.\nTake one down, pass it around, 73 bottles of beer on the wall\n\n73 bottles of beer on the wall, 73 bottles of beer.\nTake one down, pass it around, 72 bottles of beer on the wall\n\n72 bottles of beer on the wall, 72 bottles of beer.\nTake one down, pass it around, 71 bottles of beer on the wall\n\n71 bottles of beer on the wall, 71 bottles of beer.\nTake one down, pass it around, 70 bottles of beer on the wall\n\n70 bottles of beer on the wall, 70 bottles of beer.\nTake one down, pass it around, 69 bottles of beer on the wall\n\n69 bottles of beer on the wall, 69 bottles of beer.\nTake one down, pass it around, 68 bottles of beer on the wall\n\n68 bottles of beer on the wall, 68 bottles of beer.\nTake one down, pass it around, 67 bottles of beer on the wall\n\n67 bottles of beer on the wall, 67 bottles of beer.\nTake one down, pass it around, 66 bottles of beer on the wall\n\n66 bottles of beer on the wall, 66 bottles of beer.\nTake one down, pass it around, 65 bottles of beer on the wall\n\n65 bottles of beer on the wall, 65 bottles of beer.\nTake one down, pass it around, 64 bottles of beer on the wall\n\n64 bottles of beer on the wall, 64 bottles of beer.\nTake one down, pass it around, 63 bottles of beer on the wall\n\n63 bottles of beer on the wall, 63 bottles of beer.\nTake one down, pass it around, 62 bottles of beer on the wall\n\n62 bottles of beer on the wall, 62 bottles of beer.\nTake one down, pass it around, 61 bottles of beer on the wall\n\n61 bottles of beer on the wall, 61 bottles of beer.\nTake one down, pass it around, 60 bottles of beer on the wall\n\n60 bottles of beer on the wall, 60 bottles of beer.\nTake one down, pass it around, 59 bottles of beer on the wall\n\n59 bottles of beer on the wall, 59 bottles of beer.\nTake one down, pass it around, 58 bottles of beer on the wall\n\n58 bottles of beer on the wall, 58 bottles of beer.\nTake one down, pass it around, 57 bottles of beer on the wall\n\n57 bottles of beer on the wall, 57 bottles of beer.\nTake one down, pass it around, 56 bottles of beer on the wall\n\n56 bottles of beer on the wall, 56 bottles of beer.\nTak"; + + assert.strictEqual(codeOutput.language, "Lua"); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + }); + + it("Factorial", async () => { + const code = `function fact(n) + return n > 0 and n * fact(n-1) or 1 +end + +print(fact(10))`; + + const codeOutput = await pestoClient.execute({ + language: "Lua", + version: "latest", + code: code + }); + + const expectedOutput = "3628800"; + + assert.strictEqual(codeOutput.language, "Lua"); + assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); + assert.strictEqual(codeOutput.runtime.stderr, ""); + assert.strictEqual(codeOutput.runtime.exitCode, 0); + assert.strictEqual(codeOutput.compile.output, ""); + assert.strictEqual(codeOutput.compile.stdout, ""); + assert.strictEqual(codeOutput.compile.stderr, ""); + assert.strictEqual(codeOutput.compile.exitCode, 0); + }); +}); diff --git a/dogfood/package-lock.json b/dogfood/package-lock.json index a344fa8..a960d39 100644 --- a/dogfood/package-lock.json +++ b/dogfood/package-lock.json @@ -12,14 +12,23 @@ "@teknologi-umum/pesto": "^1.0.0-b75bbaa" }, "devDependencies": { - "@teknologi-umum/eslint-config-base": "^0.0.10", - "@types/node": "^18.15.11", - "eslint": "^8.41.0" + "@teknologi-umum/eslint-config-base": "^0.0.11", + "@types/node": "^18.17.0", + "eslint": "^8.43.0" }, "engines": { "node": ">=18" } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://npmjs.teknologiumum.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://npmjs.teknologiumum.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -45,14 +54,14 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.0.3", - "resolved": "https://npmjs.teknologiumum.com/@eslint/eslintrc/-/eslintrc-2.0.3.tgz", - "integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==", + "version": "2.1.0", + "resolved": "https://npmjs.teknologiumum.com/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", + "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.5.2", + "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -68,18 +77,18 @@ } }, "node_modules/@eslint/js": { - "version": "8.41.0", - "resolved": "https://npmjs.teknologiumum.com/@eslint/js/-/js-8.41.0.tgz", - "integrity": "sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA==", + "version": "8.44.0", + "resolved": "https://npmjs.teknologiumum.com/@eslint/js/-/js-8.44.0.tgz", + "integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://npmjs.teknologiumum.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "version": "0.11.10", + "resolved": "https://npmjs.teknologiumum.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", + "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -144,16 +153,22 @@ "node": ">= 8" } }, + "node_modules/@one-ini/wasm": { + "version": "0.1.1", + "resolved": "https://npmjs.teknologiumum.com/@one-ini/wasm/-/wasm-0.1.1.tgz", + "integrity": "sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==", + "dev": true + }, "node_modules/@teknologi-umum/eslint-config-base": { - "version": "0.0.10", - "resolved": "https://npmjs.teknologiumum.com/@teknologi-umum/eslint-config-base/-/eslint-config-base-0.0.10.tgz", - "integrity": "sha512-TrF+MhIIG42GQqwnsVzHbuve1HjjMSGyOkh8C9vR7ViRKPQFXccUODhUrRBdTsA4G3NWaglZugBY0FczdSFmxA==", + "version": "0.0.11", + "resolved": "https://npmjs.teknologiumum.com/@teknologi-umum/eslint-config-base/-/eslint-config-base-0.0.11.tgz", + "integrity": "sha512-KbVXkIcrJIXRSH4JGmEMaJYD0aYlodPp/qHVUsZ3VIJMiwjpPX0qtpW1/ehRsLm3f1vZjo0aFymo+5nVFD24HQ==", "dev": true, "dependencies": { - "eslint-plugin-editorconfig": "^3.2.0", + "eslint-plugin-editorconfig": "^4.0.3", "eslint-plugin-json": "^3.1.0", - "eslint-plugin-toml": "0.3.0", - "eslint-plugin-yml": "0.14.0" + "eslint-plugin-toml": "0.5.0", + "eslint-plugin-yml": "1.7.0" }, "peerDependencies": { "eslint": ">=7" @@ -170,239 +185,16 @@ "url": "https://github.com/sponsors/teknologi-umum" } }, - "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://npmjs.teknologiumum.com/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true - }, "node_modules/@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", + "version": "18.17.0", + "resolved": "https://npmjs.teknologiumum.com/@types/node/-/node-18.17.0.tgz", + "integrity": "sha512-GXZxEtOxYGFchyUzxvKI14iff9KZ2DI+A6a37o6EQevtg6uO9t+aUZKcaC1Te5Ng1OnLM7K9NVVj+FbecD9cJg==", "dev": true }, - "node_modules/@types/semver": { - "version": "7.5.0", - "resolved": "https://npmjs.teknologiumum.com/@types/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", - "dev": true - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.6.tgz", - "integrity": "sha512-sXtOgJNEuRU5RLwPUb1jxtToZbgvq3M6FPpY4QENxoOggK+UpTxUBpj6tD8+Qh2g46Pi9We87E+eHnUw8YcGsw==", - "dev": true, - "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.6", - "@typescript-eslint/type-utils": "5.59.6", - "@typescript-eslint/utils": "5.59.6", - "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/parser/-/parser-5.59.6.tgz", - "integrity": "sha512-7pCa6al03Pv1yf/dUg/s1pXz/yGMUBAw5EeWqNTFiSueKvRNonze3hma3lhdsOrQcaOXhbk5gKu2Fludiho9VA==", - "dev": true, - "peer": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.59.6", - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/typescript-estree": "5.59.6", - "debug": "^4.3.4" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.6.tgz", - "integrity": "sha512-gLbY3Le9Dxcb8KdpF0+SJr6EQ+hFGYFl6tVY8VxLPFDfUZC7BHFw+Vq7bM5lE9DwWPfx4vMWWTLGXgpc0mAYyQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/visitor-keys": "5.59.6" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/type-utils/-/type-utils-5.59.6.tgz", - "integrity": "sha512-A4tms2Mp5yNvLDlySF+kAThV9VTBPCvGf0Rp8nl/eoDX9Okun8byTKoj3fJ52IJitjWOk0fKPNQhXEB++eNozQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/typescript-estree": "5.59.6", - "@typescript-eslint/utils": "5.59.6", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/types": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/types/-/types-5.59.6.tgz", - "integrity": "sha512-tH5lBXZI7T2MOUgOWFdVNUILsI02shyQvfzG9EJkoONWugCG77NDDa1EeDGw7oJ5IvsTAAGVV8I3Tk2PNu9QfA==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.6.tgz", - "integrity": "sha512-vW6JP3lMAs/Tq4KjdI/RiHaaJSO7IUsbkz17it/Rl9Q+WkQ77EOuOnlbaU8kKfVIOJxMhnRiBG+olE7f3M16DA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/visitor-keys": "5.59.6", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/utils/-/utils-5.59.6.tgz", - "integrity": "sha512-vzaaD6EXbTS29cVH0JjXBdzMt6VBlv+hE31XktDRMX1j3462wZCJa7VzO2AxXEXcIl8GQqZPcOPuW/Z1tZVogg==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.6", - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/typescript-estree": "5.59.6", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://npmjs.teknologiumum.com/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://npmjs.teknologiumum.com/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.6.tgz", - "integrity": "sha512-zEfbFLzB9ETcEJ4HZEEsCR9HHeNku5/Qw1jSS5McYJv5BR+ftYXwFFAH5Al+xkGaZEqowMwl7uoJjQb1YSPF8Q==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.59.6", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://npmjs.teknologiumum.com/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "version": "8.10.0", + "resolved": "https://npmjs.teknologiumum.com/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -466,15 +258,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://npmjs.teknologiumum.com/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://npmjs.teknologiumum.com/balanced-match/-/balanced-match-1.0.2.tgz", @@ -491,18 +274,6 @@ "concat-map": "0.0.1" } }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://npmjs.teknologiumum.com/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://npmjs.teknologiumum.com/callsites/-/callsites-3.1.0.tgz", @@ -547,10 +318,13 @@ "dev": true }, "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://npmjs.teknologiumum.com/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "version": "10.0.1", + "resolved": "https://npmjs.teknologiumum.com/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "engines": { + "node": ">=14" + } }, "node_modules/concat-map": { "version": "0.0.1", @@ -603,18 +377,6 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://npmjs.teknologiumum.com/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://npmjs.teknologiumum.com/doctrine/-/doctrine-3.0.0.tgz", @@ -628,27 +390,45 @@ } }, "node_modules/editorconfig": { - "version": "0.15.3", - "resolved": "https://npmjs.teknologiumum.com/editorconfig/-/editorconfig-0.15.3.tgz", - "integrity": "sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==", + "version": "1.0.4", + "resolved": "https://npmjs.teknologiumum.com/editorconfig/-/editorconfig-1.0.4.tgz", + "integrity": "sha512-L9Qe08KWTlqYMVvMcTIvMAdl1cDUubzRNYL+WfA4bLDMHe4nemKkpmYzkznE1FwLKu0EEmy6obgQKzMJrg4x9Q==", "dev": true, "dependencies": { - "commander": "^2.19.0", - "lru-cache": "^4.1.5", - "semver": "^5.6.0", - "sigmund": "^1.0.1" + "@one-ini/wasm": "0.1.1", + "commander": "^10.0.0", + "minimatch": "9.0.1", + "semver": "^7.5.3" }, "bin": { "editorconfig": "bin/editorconfig" + }, + "engines": { + "node": ">=14" } }, - "node_modules/editorconfig/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://npmjs.teknologiumum.com/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "node_modules/editorconfig/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://npmjs.teknologiumum.com/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "bin": { - "semver": "bin/semver" + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/editorconfig/node_modules/minimatch": { + "version": "9.0.1", + "resolved": "https://npmjs.teknologiumum.com/minimatch/-/minimatch-9.0.1.tgz", + "integrity": "sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/escape-string-regexp": { @@ -664,16 +444,16 @@ } }, "node_modules/eslint": { - "version": "8.41.0", - "resolved": "https://npmjs.teknologiumum.com/eslint/-/eslint-8.41.0.tgz", - "integrity": "sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q==", + "version": "8.45.0", + "resolved": "https://npmjs.teknologiumum.com/eslint/-/eslint-8.45.0.tgz", + "integrity": "sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.0.3", - "@eslint/js": "8.41.0", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint/eslintrc": "^2.1.0", + "@eslint/js": "8.44.0", + "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -684,7 +464,7 @@ "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.2.0", "eslint-visitor-keys": "^3.4.1", - "espree": "^9.5.2", + "espree": "^9.6.0", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -694,7 +474,6 @@ "globals": "^13.19.0", "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", @@ -704,9 +483,8 @@ "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "bin": { @@ -720,15 +498,18 @@ } }, "node_modules/eslint-plugin-editorconfig": { - "version": "3.2.0", - "resolved": "https://npmjs.teknologiumum.com/eslint-plugin-editorconfig/-/eslint-plugin-editorconfig-3.2.0.tgz", - "integrity": "sha512-XiUg69+qgv6BekkPCjP8+2DMODzPqtLV5i0Q9FO1v40P62pfodG1vjIihVbw/338hS5W26S+8MTtXaAlrg37QQ==", + "version": "4.0.3", + "resolved": "https://npmjs.teknologiumum.com/eslint-plugin-editorconfig/-/eslint-plugin-editorconfig-4.0.3.tgz", + "integrity": "sha512-5YeDxm6mlv75DrTbRBK9Jw2ogqhjiz8ZCvv9bkuz/MXq0603q9FpQvQlamtas4bX1Gji4YcksY7dq7stPeGaLQ==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "^5.0.0", - "editorconfig": "^0.15.0", - "eslint": "^8.0.1", + "editorconfig": "^1.0.2", + "eslint": "^8.40.0", "klona": "^2.0.4" + }, + "engines": { + "node": ">=14", + "npm": ">=8" } }, "node_modules/eslint-plugin-json": { @@ -745,35 +526,38 @@ } }, "node_modules/eslint-plugin-toml": { - "version": "0.3.0", - "resolved": "https://npmjs.teknologiumum.com/eslint-plugin-toml/-/eslint-plugin-toml-0.3.0.tgz", - "integrity": "sha512-XISdju8PKnuUml95Iq3Y8lJVG/EHUPhIjMHnoJRAUKDnGLCtljlJEiupuw5MA+vV+Gxhlxf6FAaKw1ICHNqkkg==", + "version": "0.5.0", + "resolved": "https://npmjs.teknologiumum.com/eslint-plugin-toml/-/eslint-plugin-toml-0.5.0.tgz", + "integrity": "sha512-EnnC+/PEdaScDmQWrJeQlOFSLdulyVkRAbWX4X97Tju7Y2W/2pT6f1BVqEAjHAMjl9daRh+cS2U3Ik6i5E+C5Q==", "dev": true, "dependencies": { "debug": "^4.1.1", "lodash": "^4.17.19", - "toml-eslint-parser": "^0.3.0" + "toml-eslint-parser": "^0.6.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, "peerDependencies": { "eslint": ">=6.0.0" } }, "node_modules/eslint-plugin-yml": { - "version": "0.14.0", - "resolved": "https://npmjs.teknologiumum.com/eslint-plugin-yml/-/eslint-plugin-yml-0.14.0.tgz", - "integrity": "sha512-+0+bBV/07txENbxfrHF9olGoLCHez64vmnOmjWOoLwmXOwfdaSRleBSPIi4nWQs7WwX8lm/fSLadOjbVEcsXQQ==", + "version": "1.7.0", + "resolved": "https://npmjs.teknologiumum.com/eslint-plugin-yml/-/eslint-plugin-yml-1.7.0.tgz", + "integrity": "sha512-qq61FQJk+qIgWl0R06bec7UQQEIBrUH22jS+MroTbFUKu+3/iVlGRpZd8mjpOAm/+H/WEDFwy4x/+kKgVGbsWw==", "dev": true, "dependencies": { "debug": "^4.3.2", "lodash": "^4.17.21", "natural-compare": "^1.4.0", - "yaml-eslint-parser": "^0.5.0" + "yaml-eslint-parser": "^1.2.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^14.17.0 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/ota-meshi" @@ -811,12 +595,12 @@ } }, "node_modules/espree": { - "version": "9.5.2", - "resolved": "https://npmjs.teknologiumum.com/espree/-/espree-9.5.2.tgz", - "integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==", + "version": "9.6.1", + "resolved": "https://npmjs.teknologiumum.com/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "dependencies": { - "acorn": "^8.8.0", + "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.4.1" }, @@ -875,34 +659,6 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://npmjs.teknologiumum.com/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://npmjs.teknologiumum.com/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://npmjs.teknologiumum.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -958,18 +714,6 @@ "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://npmjs.teknologiumum.com/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://npmjs.teknologiumum.com/find-up/-/find-up-5.0.0.tgz", @@ -1069,32 +813,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://npmjs.teknologiumum.com/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://npmjs.teknologiumum.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://npmjs.teknologiumum.com/graphemer/-/graphemer-1.4.0.tgz", @@ -1181,15 +899,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://npmjs.teknologiumum.com/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/is-path-inside": { "version": "3.0.3", "resolved": "https://npmjs.teknologiumum.com/is-path-inside/-/is-path-inside-3.0.3.tgz", @@ -1285,35 +994,15 @@ "dev": true }, "node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://npmjs.teknologiumum.com/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://npmjs.teknologiumum.com/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://npmjs.teknologiumum.com/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "6.0.0", + "resolved": "https://npmjs.teknologiumum.com/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" + "yallist": "^4.0.0" }, "engines": { - "node": ">=8.6" + "node": ">=10" } }, "node_modules/minimatch": { @@ -1340,12 +1029,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://npmjs.teknologiumum.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node_modules/node-domexception": { "version": "1.0.0", "resolved": "https://npmjs.teknologiumum.com/node-domexception/-/node-domexception-1.0.0.tgz", @@ -1391,17 +1074,17 @@ } }, "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://npmjs.teknologiumum.com/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://npmjs.teknologiumum.com/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" }, "engines": { "node": ">= 0.8.0" @@ -1476,27 +1159,6 @@ "node": ">=8" } }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://npmjs.teknologiumum.com/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://npmjs.teknologiumum.com/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://npmjs.teknologiumum.com/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -1506,12 +1168,6 @@ "node": ">= 0.8.0" } }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://npmjs.teknologiumum.com/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", - "dev": true - }, "node_modules/punycode": { "version": "2.3.0", "resolved": "https://npmjs.teknologiumum.com/punycode/-/punycode-2.3.0.tgz", @@ -1599,9 +1255,9 @@ } }, "node_modules/semver": { - "version": "7.5.1", - "resolved": "https://npmjs.teknologiumum.com/semver/-/semver-7.5.1.tgz", - "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "version": "7.5.4", + "resolved": "https://npmjs.teknologiumum.com/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1613,24 +1269,6 @@ "node": ">=10" } }, - "node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://npmjs.teknologiumum.com/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://npmjs.teknologiumum.com/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://npmjs.teknologiumum.com/shebang-command/-/shebang-command-2.0.0.tgz", @@ -1652,21 +1290,6 @@ "node": ">=8" } }, - "node_modules/sigmund": { - "version": "1.0.1", - "resolved": "https://npmjs.teknologiumum.com/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==", - "dev": true - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://npmjs.teknologiumum.com/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://npmjs.teknologiumum.com/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -1709,49 +1332,19 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://npmjs.teknologiumum.com/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/toml-eslint-parser": { - "version": "0.3.0", - "resolved": "https://npmjs.teknologiumum.com/toml-eslint-parser/-/toml-eslint-parser-0.3.0.tgz", - "integrity": "sha512-oHSO8avJ1nANY6DOgpyMTSN+HpGv7nlg5rO5pcnnud0cUxq8s3IhUe8dGXsnX4ut+0azcaxGXQ/pWe0OR6Kjxg==", + "version": "0.6.0", + "resolved": "https://npmjs.teknologiumum.com/toml-eslint-parser/-/toml-eslint-parser-0.6.0.tgz", + "integrity": "sha512-aTmQa0RFb+2URe8IZOfo/oxt3b5rlXlpG9xE+6FmeI8immCGLnZYvKVxbnCYJx4bIKIaEwl0BnCDhwO70yeWSA==", "dev": true, "dependencies": { "eslint-visitor-keys": "^3.0.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://npmjs.teknologiumum.com/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://npmjs.teknologiumum.com/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + "funding": { + "url": "https://github.com/sponsors/ota-meshi" } }, "node_modules/type-check": { @@ -1778,20 +1371,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://npmjs.teknologiumum.com/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", - "dev": true, - "peer": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=12.20" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://npmjs.teknologiumum.com/uri-js/-/uri-js-4.4.1.tgz", @@ -1861,15 +1440,6 @@ "node": ">= 8" } }, - "node_modules/word-wrap": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", - "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://npmjs.teknologiumum.com/wrappy/-/wrappy-1.0.2.tgz", @@ -1877,32 +1447,35 @@ "dev": true }, "node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://npmjs.teknologiumum.com/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", + "version": "4.0.0", + "resolved": "https://npmjs.teknologiumum.com/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://npmjs.teknologiumum.com/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "version": "2.3.1", + "resolved": "https://npmjs.teknologiumum.com/yaml/-/yaml-2.3.1.tgz", + "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", "dev": true, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/yaml-eslint-parser": { - "version": "0.5.0", - "resolved": "https://npmjs.teknologiumum.com/yaml-eslint-parser/-/yaml-eslint-parser-0.5.0.tgz", - "integrity": "sha512-nJeyLA3YHAzhBTZbRAbu3W6xrSCucyxExmA+ZDtEdUFpGllxAZpto2Zxo2IG0r0eiuEiBM4e+wiAdxTziTq94g==", + "version": "1.2.2", + "resolved": "https://npmjs.teknologiumum.com/yaml-eslint-parser/-/yaml-eslint-parser-1.2.2.tgz", + "integrity": "sha512-pEwzfsKbTrB8G3xc/sN7aw1v6A6c/pKxLAkjclnAyo5g5qOh6eL9WGu0o3cSDQZKrTNk4KL4lQSwZW+nBkANEg==", "dev": true, "dependencies": { "eslint-visitor-keys": "^3.0.0", "lodash": "^4.17.21", - "yaml": "^1.10.2" + "yaml": "^2.0.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" } }, "node_modules/yocto-queue": { @@ -1919,6 +1492,12 @@ } }, "dependencies": { + "@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://npmjs.teknologiumum.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true + }, "@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://npmjs.teknologiumum.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -1935,14 +1514,14 @@ "dev": true }, "@eslint/eslintrc": { - "version": "2.0.3", - "resolved": "https://npmjs.teknologiumum.com/@eslint/eslintrc/-/eslintrc-2.0.3.tgz", - "integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==", + "version": "2.1.0", + "resolved": "https://npmjs.teknologiumum.com/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", + "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.5.2", + "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -1952,15 +1531,15 @@ } }, "@eslint/js": { - "version": "8.41.0", - "resolved": "https://npmjs.teknologiumum.com/@eslint/js/-/js-8.41.0.tgz", - "integrity": "sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA==", + "version": "8.44.0", + "resolved": "https://npmjs.teknologiumum.com/@eslint/js/-/js-8.44.0.tgz", + "integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", "dev": true }, "@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://npmjs.teknologiumum.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "version": "0.11.10", + "resolved": "https://npmjs.teknologiumum.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", + "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", @@ -2006,16 +1585,22 @@ "fastq": "^1.6.0" } }, + "@one-ini/wasm": { + "version": "0.1.1", + "resolved": "https://npmjs.teknologiumum.com/@one-ini/wasm/-/wasm-0.1.1.tgz", + "integrity": "sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==", + "dev": true + }, "@teknologi-umum/eslint-config-base": { - "version": "0.0.10", - "resolved": "https://npmjs.teknologiumum.com/@teknologi-umum/eslint-config-base/-/eslint-config-base-0.0.10.tgz", - "integrity": "sha512-TrF+MhIIG42GQqwnsVzHbuve1HjjMSGyOkh8C9vR7ViRKPQFXccUODhUrRBdTsA4G3NWaglZugBY0FczdSFmxA==", + "version": "0.0.11", + "resolved": "https://npmjs.teknologiumum.com/@teknologi-umum/eslint-config-base/-/eslint-config-base-0.0.11.tgz", + "integrity": "sha512-KbVXkIcrJIXRSH4JGmEMaJYD0aYlodPp/qHVUsZ3VIJMiwjpPX0qtpW1/ehRsLm3f1vZjo0aFymo+5nVFD24HQ==", "dev": true, "requires": { - "eslint-plugin-editorconfig": "^3.2.0", + "eslint-plugin-editorconfig": "^4.0.3", "eslint-plugin-json": "^3.1.0", - "eslint-plugin-toml": "0.3.0", - "eslint-plugin-yml": "0.14.0" + "eslint-plugin-toml": "0.5.0", + "eslint-plugin-yml": "1.7.0" } }, "@teknologi-umum/pesto": { @@ -2026,146 +1611,16 @@ "node-fetch": "^3.3.0" } }, - "@types/json-schema": { - "version": "7.0.11", - "resolved": "https://npmjs.teknologiumum.com/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true - }, "@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", - "dev": true - }, - "@types/semver": { - "version": "7.5.0", - "resolved": "https://npmjs.teknologiumum.com/@types/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", + "version": "18.17.0", + "resolved": "https://npmjs.teknologiumum.com/@types/node/-/node-18.17.0.tgz", + "integrity": "sha512-GXZxEtOxYGFchyUzxvKI14iff9KZ2DI+A6a37o6EQevtg6uO9t+aUZKcaC1Te5Ng1OnLM7K9NVVj+FbecD9cJg==", "dev": true }, - "@typescript-eslint/eslint-plugin": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.6.tgz", - "integrity": "sha512-sXtOgJNEuRU5RLwPUb1jxtToZbgvq3M6FPpY4QENxoOggK+UpTxUBpj6tD8+Qh2g46Pi9We87E+eHnUw8YcGsw==", - "dev": true, - "requires": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.6", - "@typescript-eslint/type-utils": "5.59.6", - "@typescript-eslint/utils": "5.59.6", - "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/parser": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/parser/-/parser-5.59.6.tgz", - "integrity": "sha512-7pCa6al03Pv1yf/dUg/s1pXz/yGMUBAw5EeWqNTFiSueKvRNonze3hma3lhdsOrQcaOXhbk5gKu2Fludiho9VA==", - "dev": true, - "peer": true, - "requires": { - "@typescript-eslint/scope-manager": "5.59.6", - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/typescript-estree": "5.59.6", - "debug": "^4.3.4" - } - }, - "@typescript-eslint/scope-manager": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.6.tgz", - "integrity": "sha512-gLbY3Le9Dxcb8KdpF0+SJr6EQ+hFGYFl6tVY8VxLPFDfUZC7BHFw+Vq7bM5lE9DwWPfx4vMWWTLGXgpc0mAYyQ==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/visitor-keys": "5.59.6" - } - }, - "@typescript-eslint/type-utils": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/type-utils/-/type-utils-5.59.6.tgz", - "integrity": "sha512-A4tms2Mp5yNvLDlySF+kAThV9VTBPCvGf0Rp8nl/eoDX9Okun8byTKoj3fJ52IJitjWOk0fKPNQhXEB++eNozQ==", - "dev": true, - "requires": { - "@typescript-eslint/typescript-estree": "5.59.6", - "@typescript-eslint/utils": "5.59.6", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/types": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/types/-/types-5.59.6.tgz", - "integrity": "sha512-tH5lBXZI7T2MOUgOWFdVNUILsI02shyQvfzG9EJkoONWugCG77NDDa1EeDGw7oJ5IvsTAAGVV8I3Tk2PNu9QfA==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.6.tgz", - "integrity": "sha512-vW6JP3lMAs/Tq4KjdI/RiHaaJSO7IUsbkz17it/Rl9Q+WkQ77EOuOnlbaU8kKfVIOJxMhnRiBG+olE7f3M16DA==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/visitor-keys": "5.59.6", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/utils": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/utils/-/utils-5.59.6.tgz", - "integrity": "sha512-vzaaD6EXbTS29cVH0JjXBdzMt6VBlv+hE31XktDRMX1j3462wZCJa7VzO2AxXEXcIl8GQqZPcOPuW/Z1tZVogg==", - "dev": true, - "requires": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.6", - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/typescript-estree": "5.59.6", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - }, - "dependencies": { - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://npmjs.teknologiumum.com/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://npmjs.teknologiumum.com/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - } - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.59.6", - "resolved": "https://npmjs.teknologiumum.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.6.tgz", - "integrity": "sha512-zEfbFLzB9ETcEJ4HZEEsCR9HHeNku5/Qw1jSS5McYJv5BR+ftYXwFFAH5Al+xkGaZEqowMwl7uoJjQb1YSPF8Q==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.59.6", - "eslint-visitor-keys": "^3.3.0" - } - }, "acorn": { - "version": "8.8.2", - "resolved": "https://npmjs.teknologiumum.com/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "version": "8.10.0", + "resolved": "https://npmjs.teknologiumum.com/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true }, "acorn-jsx": { @@ -2208,12 +1663,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "array-union": { - "version": "2.1.0", - "resolved": "https://npmjs.teknologiumum.com/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, "balanced-match": { "version": "1.0.2", "resolved": "https://npmjs.teknologiumum.com/balanced-match/-/balanced-match-1.0.2.tgz", @@ -2230,15 +1679,6 @@ "concat-map": "0.0.1" } }, - "braces": { - "version": "3.0.2", - "resolved": "https://npmjs.teknologiumum.com/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, "callsites": { "version": "3.1.0", "resolved": "https://npmjs.teknologiumum.com/callsites/-/callsites-3.1.0.tgz", @@ -2271,9 +1711,9 @@ "dev": true }, "commander": { - "version": "2.20.3", - "resolved": "https://npmjs.teknologiumum.com/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "version": "10.0.1", + "resolved": "https://npmjs.teknologiumum.com/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true }, "concat-map": { @@ -2313,15 +1753,6 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://npmjs.teknologiumum.com/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, "doctrine": { "version": "3.0.0", "resolved": "https://npmjs.teknologiumum.com/doctrine/-/doctrine-3.0.0.tgz", @@ -2332,22 +1763,34 @@ } }, "editorconfig": { - "version": "0.15.3", - "resolved": "https://npmjs.teknologiumum.com/editorconfig/-/editorconfig-0.15.3.tgz", - "integrity": "sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==", + "version": "1.0.4", + "resolved": "https://npmjs.teknologiumum.com/editorconfig/-/editorconfig-1.0.4.tgz", + "integrity": "sha512-L9Qe08KWTlqYMVvMcTIvMAdl1cDUubzRNYL+WfA4bLDMHe4nemKkpmYzkznE1FwLKu0EEmy6obgQKzMJrg4x9Q==", "dev": true, "requires": { - "commander": "^2.19.0", - "lru-cache": "^4.1.5", - "semver": "^5.6.0", - "sigmund": "^1.0.1" + "@one-ini/wasm": "0.1.1", + "commander": "^10.0.0", + "minimatch": "9.0.1", + "semver": "^7.5.3" }, "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://npmjs.teknologiumum.com/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://npmjs.teknologiumum.com/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "9.0.1", + "resolved": "https://npmjs.teknologiumum.com/minimatch/-/minimatch-9.0.1.tgz", + "integrity": "sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } } } }, @@ -2358,16 +1801,16 @@ "dev": true }, "eslint": { - "version": "8.41.0", - "resolved": "https://npmjs.teknologiumum.com/eslint/-/eslint-8.41.0.tgz", - "integrity": "sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q==", + "version": "8.45.0", + "resolved": "https://npmjs.teknologiumum.com/eslint/-/eslint-8.45.0.tgz", + "integrity": "sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.0.3", - "@eslint/js": "8.41.0", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint/eslintrc": "^2.1.0", + "@eslint/js": "8.44.0", + "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -2378,7 +1821,7 @@ "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.2.0", "eslint-visitor-keys": "^3.4.1", - "espree": "^9.5.2", + "espree": "^9.6.0", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -2388,7 +1831,6 @@ "globals": "^13.19.0", "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", @@ -2398,21 +1840,19 @@ "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" } }, "eslint-plugin-editorconfig": { - "version": "3.2.0", - "resolved": "https://npmjs.teknologiumum.com/eslint-plugin-editorconfig/-/eslint-plugin-editorconfig-3.2.0.tgz", - "integrity": "sha512-XiUg69+qgv6BekkPCjP8+2DMODzPqtLV5i0Q9FO1v40P62pfodG1vjIihVbw/338hS5W26S+8MTtXaAlrg37QQ==", + "version": "4.0.3", + "resolved": "https://npmjs.teknologiumum.com/eslint-plugin-editorconfig/-/eslint-plugin-editorconfig-4.0.3.tgz", + "integrity": "sha512-5YeDxm6mlv75DrTbRBK9Jw2ogqhjiz8ZCvv9bkuz/MXq0603q9FpQvQlamtas4bX1Gji4YcksY7dq7stPeGaLQ==", "dev": true, "requires": { - "@typescript-eslint/eslint-plugin": "^5.0.0", - "editorconfig": "^0.15.0", - "eslint": "^8.0.1", + "editorconfig": "^1.0.2", + "eslint": "^8.40.0", "klona": "^2.0.4" } }, @@ -2427,26 +1867,26 @@ } }, "eslint-plugin-toml": { - "version": "0.3.0", - "resolved": "https://npmjs.teknologiumum.com/eslint-plugin-toml/-/eslint-plugin-toml-0.3.0.tgz", - "integrity": "sha512-XISdju8PKnuUml95Iq3Y8lJVG/EHUPhIjMHnoJRAUKDnGLCtljlJEiupuw5MA+vV+Gxhlxf6FAaKw1ICHNqkkg==", + "version": "0.5.0", + "resolved": "https://npmjs.teknologiumum.com/eslint-plugin-toml/-/eslint-plugin-toml-0.5.0.tgz", + "integrity": "sha512-EnnC+/PEdaScDmQWrJeQlOFSLdulyVkRAbWX4X97Tju7Y2W/2pT6f1BVqEAjHAMjl9daRh+cS2U3Ik6i5E+C5Q==", "dev": true, "requires": { "debug": "^4.1.1", "lodash": "^4.17.19", - "toml-eslint-parser": "^0.3.0" + "toml-eslint-parser": "^0.6.0" } }, "eslint-plugin-yml": { - "version": "0.14.0", - "resolved": "https://npmjs.teknologiumum.com/eslint-plugin-yml/-/eslint-plugin-yml-0.14.0.tgz", - "integrity": "sha512-+0+bBV/07txENbxfrHF9olGoLCHez64vmnOmjWOoLwmXOwfdaSRleBSPIi4nWQs7WwX8lm/fSLadOjbVEcsXQQ==", + "version": "1.7.0", + "resolved": "https://npmjs.teknologiumum.com/eslint-plugin-yml/-/eslint-plugin-yml-1.7.0.tgz", + "integrity": "sha512-qq61FQJk+qIgWl0R06bec7UQQEIBrUH22jS+MroTbFUKu+3/iVlGRpZd8mjpOAm/+H/WEDFwy4x/+kKgVGbsWw==", "dev": true, "requires": { "debug": "^4.3.2", "lodash": "^4.17.21", "natural-compare": "^1.4.0", - "yaml-eslint-parser": "^0.5.0" + "yaml-eslint-parser": "^1.2.1" } }, "eslint-scope": { @@ -2466,12 +1906,12 @@ "dev": true }, "espree": { - "version": "9.5.2", - "resolved": "https://npmjs.teknologiumum.com/espree/-/espree-9.5.2.tgz", - "integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==", + "version": "9.6.1", + "resolved": "https://npmjs.teknologiumum.com/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "requires": { - "acorn": "^8.8.0", + "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.4.1" } @@ -2512,30 +1952,6 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, - "fast-glob": { - "version": "3.2.12", - "resolved": "https://npmjs.teknologiumum.com/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "dependencies": { - "glob-parent": { - "version": "5.1.2", - "resolved": "https://npmjs.teknologiumum.com/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - } - } - }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://npmjs.teknologiumum.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2575,15 +1991,6 @@ "flat-cache": "^3.0.4" } }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://npmjs.teknologiumum.com/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, "find-up": { "version": "5.0.0", "resolved": "https://npmjs.teknologiumum.com/find-up/-/find-up-5.0.0.tgz", @@ -2656,26 +2063,6 @@ "type-fest": "^0.20.2" } }, - "globby": { - "version": "11.1.0", - "resolved": "https://npmjs.teknologiumum.com/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, - "grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://npmjs.teknologiumum.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, "graphemer": { "version": "1.4.0", "resolved": "https://npmjs.teknologiumum.com/graphemer/-/graphemer-1.4.0.tgz", @@ -2741,12 +2128,6 @@ "is-extglob": "^2.1.1" } }, - "is-number": { - "version": "7.0.0", - "resolved": "https://npmjs.teknologiumum.com/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, "is-path-inside": { "version": "3.0.3", "resolved": "https://npmjs.teknologiumum.com/is-path-inside/-/is-path-inside-3.0.3.tgz", @@ -2824,29 +2205,12 @@ "dev": true }, "lru-cache": { - "version": "4.1.5", - "resolved": "https://npmjs.teknologiumum.com/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://npmjs.teknologiumum.com/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://npmjs.teknologiumum.com/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "6.0.0", + "resolved": "https://npmjs.teknologiumum.com/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" + "yallist": "^4.0.0" } }, "minimatch": { @@ -2870,12 +2234,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://npmjs.teknologiumum.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node-domexception": { "version": "1.0.0", "resolved": "https://npmjs.teknologiumum.com/node-domexception/-/node-domexception-1.0.0.tgz", @@ -2901,17 +2259,17 @@ } }, "optionator": { - "version": "0.9.1", - "resolved": "https://npmjs.teknologiumum.com/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://npmjs.teknologiumum.com/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "requires": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" } }, "p-limit": { @@ -2959,30 +2317,12 @@ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, - "path-type": { - "version": "4.0.0", - "resolved": "https://npmjs.teknologiumum.com/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://npmjs.teknologiumum.com/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, "prelude-ls": { "version": "1.2.1", "resolved": "https://npmjs.teknologiumum.com/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://npmjs.teknologiumum.com/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", - "dev": true - }, "punycode": { "version": "2.3.0", "resolved": "https://npmjs.teknologiumum.com/punycode/-/punycode-2.3.0.tgz", @@ -3026,29 +2366,12 @@ } }, "semver": { - "version": "7.5.1", - "resolved": "https://npmjs.teknologiumum.com/semver/-/semver-7.5.1.tgz", - "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "version": "7.5.4", + "resolved": "https://npmjs.teknologiumum.com/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://npmjs.teknologiumum.com/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://npmjs.teknologiumum.com/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } } }, "shebang-command": { @@ -3066,18 +2389,6 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, - "sigmund": { - "version": "1.0.1", - "resolved": "https://npmjs.teknologiumum.com/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==", - "dev": true - }, - "slash": { - "version": "3.0.0", - "resolved": "https://npmjs.teknologiumum.com/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, "strip-ansi": { "version": "6.0.1", "resolved": "https://npmjs.teknologiumum.com/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -3108,39 +2419,15 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://npmjs.teknologiumum.com/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, "toml-eslint-parser": { - "version": "0.3.0", - "resolved": "https://npmjs.teknologiumum.com/toml-eslint-parser/-/toml-eslint-parser-0.3.0.tgz", - "integrity": "sha512-oHSO8avJ1nANY6DOgpyMTSN+HpGv7nlg5rO5pcnnud0cUxq8s3IhUe8dGXsnX4ut+0azcaxGXQ/pWe0OR6Kjxg==", + "version": "0.6.0", + "resolved": "https://npmjs.teknologiumum.com/toml-eslint-parser/-/toml-eslint-parser-0.6.0.tgz", + "integrity": "sha512-aTmQa0RFb+2URe8IZOfo/oxt3b5rlXlpG9xE+6FmeI8immCGLnZYvKVxbnCYJx4bIKIaEwl0BnCDhwO70yeWSA==", "dev": true, "requires": { "eslint-visitor-keys": "^3.0.0" } }, - "tslib": { - "version": "1.14.1", - "resolved": "https://npmjs.teknologiumum.com/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://npmjs.teknologiumum.com/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, "type-check": { "version": "0.4.0", "resolved": "https://npmjs.teknologiumum.com/type-check/-/type-check-0.4.0.tgz", @@ -3156,13 +2443,6 @@ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true }, - "typescript": { - "version": "5.0.4", - "resolved": "https://npmjs.teknologiumum.com/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", - "dev": true, - "peer": true - }, "uri-js": { "version": "4.4.1", "resolved": "https://npmjs.teknologiumum.com/uri-js/-/uri-js-4.4.1.tgz", @@ -3223,12 +2503,6 @@ "isexe": "^2.0.0" } }, - "word-wrap": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", - "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", - "dev": true - }, "wrappy": { "version": "1.0.2", "resolved": "https://npmjs.teknologiumum.com/wrappy/-/wrappy-1.0.2.tgz", @@ -3236,26 +2510,26 @@ "dev": true }, "yallist": { - "version": "2.1.2", - "resolved": "https://npmjs.teknologiumum.com/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", + "version": "4.0.0", + "resolved": "https://npmjs.teknologiumum.com/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, "yaml": { - "version": "1.10.2", - "resolved": "https://npmjs.teknologiumum.com/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "version": "2.3.1", + "resolved": "https://npmjs.teknologiumum.com/yaml/-/yaml-2.3.1.tgz", + "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", "dev": true }, "yaml-eslint-parser": { - "version": "0.5.0", - "resolved": "https://npmjs.teknologiumum.com/yaml-eslint-parser/-/yaml-eslint-parser-0.5.0.tgz", - "integrity": "sha512-nJeyLA3YHAzhBTZbRAbu3W6xrSCucyxExmA+ZDtEdUFpGllxAZpto2Zxo2IG0r0eiuEiBM4e+wiAdxTziTq94g==", + "version": "1.2.2", + "resolved": "https://npmjs.teknologiumum.com/yaml-eslint-parser/-/yaml-eslint-parser-1.2.2.tgz", + "integrity": "sha512-pEwzfsKbTrB8G3xc/sN7aw1v6A6c/pKxLAkjclnAyo5g5qOh6eL9WGu0o3cSDQZKrTNk4KL4lQSwZW+nBkANEg==", "dev": true, "requires": { "eslint-visitor-keys": "^3.0.0", "lodash": "^4.17.21", - "yaml": "^1.10.2" + "yaml": "^2.0.0" } }, "yocto-queue": { diff --git a/dogfood/package.json b/dogfood/package.json index db86ea4..7ab54b8 100644 --- a/dogfood/package.json +++ b/dogfood/package.json @@ -10,15 +10,16 @@ "node": ">=18" }, "scripts": { - "test": "node test.js" + "test": "node test.js", + "lint": "eslint --fix --ignore-path .gitignore ." }, "keywords": [], "author": "", "license": "Apache-2.0", "devDependencies": { - "@teknologi-umum/eslint-config-base": "^0.0.10", - "@types/node": "^18.15.11", - "eslint": "^8.41.0" + "@teknologi-umum/eslint-config-base": "^0.0.11", + "@types/node": "^18.17.0", + "eslint": "^8.43.0" }, "dependencies": { "@teknologi-umum/pesto": "^1.0.0-b75bbaa" diff --git a/dogfood/php.test.js b/dogfood/php.test.js index 59f10d3..16153ee 100644 --- a/dogfood/php.test.js +++ b/dogfood/php.test.js @@ -40,7 +40,7 @@ describe("PHP", {concurrency: true}, () => { assert.strictEqual(codeOutput.compile.output, ""); assert.strictEqual(codeOutput.compile.stderr, ""); assert.strictEqual(codeOutput.compile.exitCode, 0); - }) + }); it("Caesar Cipher", async () => { const code = ` { assert.strictEqual(codeOutput.compile.output, ""); assert.strictEqual(codeOutput.compile.stderr, ""); assert.strictEqual(codeOutput.compile.exitCode, 0); - }) + }); // https://rosettacode.org/wiki/Cartesian_product_of_two_or_more_lists#Python it("Cartesian Equation", async () => { @@ -72,7 +72,7 @@ if __name__ == '__main__': assert.strictEqual(codeOutput.compile.output, ""); assert.strictEqual(codeOutput.compile.stderr, ""); assert.strictEqual(codeOutput.compile.exitCode, 0); - }) + }); it("Caesar Cipher", async () => { const code = `from string import ascii_uppercase as abc @@ -82,7 +82,7 @@ def caesar(s, k, decode = False): return ''.join(trans[L] for L in s.upper() if L in abc) msg = "The quick brown fox jumped over the lazy dogs" -print(caesar(msg, 11))` +print(caesar(msg, 11))`; const codeOutput = await pestoClient.execute({ language: "Python", @@ -210,5 +210,5 @@ if __name__ == '__main__': assert.strictEqual(codeOutput.runtime.stdout?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.output?.trim(), expectedOutput); assert.strictEqual(codeOutput.runtime.exitCode, 0); - }) -}) + }); +}); diff --git a/dogfood/sqlite3.test.js b/dogfood/sqlite3.test.js index f39dc36..8b73ba6 100644 --- a/dogfood/sqlite3.test.js +++ b/dogfood/sqlite3.test.js @@ -61,5 +61,5 @@ describe("SQLite3", {concurrency: true}, () => { assert.strictEqual(codeOutput.compile.output, ""); assert.strictEqual(codeOutput.compile.stderr, ""); assert.strictEqual(codeOutput.compile.exitCode, 0); - }) -}) + }); +}); diff --git a/rce/packages/c/config.toml b/rce/packages/c/config.toml index 052bb8a..e2275b7 100644 --- a/rce/packages/c/config.toml +++ b/rce/packages/c/config.toml @@ -10,6 +10,7 @@ build_command = [ "-O2", "-std=c99", "-pedantic", + "-lm", "-o", "code", "{file}" diff --git a/rce/packages/go/config.toml b/rce/packages/go/config.toml index 06d5185..13b1b0c 100644 --- a/rce/packages/go/config.toml +++ b/rce/packages/go/config.toml @@ -9,5 +9,5 @@ environment = [ "GOPATH=/opt/go/1.20/go", "PATH=/usr/local/sbin:/usr/local/bin:/ aliases = [ "go", "golang" ] should_limit_memory = false memory_limit = 0 -process_limit = 1024 +process_limit = 2048 allowed_entrypoints = -1 diff --git a/sdk/README.md b/sdk/README.md index 9ea957f..dad49ef 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -1,7 +1,7 @@ -# SDK for Pesto - -This directory contains SDK (Software Development Kit) to interact with Pesto's API. - -To create new language support, feel free to create a pull request. Omit the code editor/IDE settings directory, - -such as `.vscode` and `.idea` from Git. \ No newline at end of file +# SDK for Pesto + +This directory contains SDK (Software Development Kit) to interact with Pesto's API. + +To create new language support, feel free to create a pull request. Omit the code editor/IDE settings directory, + +such as `.vscode` and `.idea` from Git.