From fb266f556bfdc3ed2d326b9d70055faff5792fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Tue, 8 Mar 2022 16:58:14 +0000 Subject: [PATCH] chore: downgrade nix-shell to use node 6 fix: use of spread operator --- lib/bill_math.js | 9 +++------ shell.nix | 8 ++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/bill_math.js b/lib/bill_math.js index 7af0234e0..f4ef13d5a 100644 --- a/lib/bill_math.js +++ b/lib/bill_math.js @@ -57,16 +57,16 @@ function unmergeCassettes(cassettes, output) { const amountNeeded = map[it.denomination] if (!amountNeeded) { - return response.push({ provisioned: 0, ...value }) + return response.push(Object.assign({ provisioned: 0 }, value)) } if (amountNeeded < it.count) { map[it.denomination] = 0 - return response.push({ provisioned: amountNeeded, ...value }) + return response.push(Object.assign({ provisioned: amountNeeded }, value)) } map[it.denomination] -= it.count - return response.push({ provisioned: it.count, ...value }) + return response.push(Object.assign({ provisioned: it.count }, value)) }, cassettes) return response @@ -109,7 +109,6 @@ function makeChange(outCassettes, amount) { ) if (available < amount) { - console.log(`Tried to dispense more than was available for amount ${amount.toNumber()} with cassettes ${JSON.stringify(cassettes)}`) return null } @@ -136,8 +135,6 @@ function makeChangeDynamicBruteForce(outCassettes, amount, available) { const { denomination: denomination2, count: count2 } = cassettes[2] const { denomination: denomination3, count: count3 } = cassettes[3] - const startTime = new Date().getTime() - loop1: for (let i = 0; i <= count0; i++) { const firstSum = i * denomination0 diff --git a/shell.nix b/shell.nix index 64164ab1b..f146cd963 100644 --- a/shell.nix +++ b/shell.nix @@ -1,14 +1,14 @@ with import (fetchTarball { name = "nixpkgs-19.03"; - url = https://github.com/NixOS/nixpkgs-channels/archive/f52505fac8c82716872a616c501ad9eff188f97f.tar.gz; - sha256 = "0q2m2qhyga9yq29yz90ywgjbn9hdahs7i8wwlq7b55rdbyiwa5dy"; + url = https://github.com/NixOS/nixpkgs-channels/archive/69fabc286f745bca37a8cbead3665de31758e778.tar.gz; + sha256 = "0mkqv8d4vh6r1b34n7ik0gpzqhf60sj1masd89jndlckvklqh69j"; }) {}; stdenv.mkDerivation { name = "node"; buildInputs = [ - nodejs-8_x + nodejs-6_x openssl_1_0_2 python2Full entr @@ -18,4 +18,4 @@ stdenv.mkDerivation { shellHook = '' export PATH="$PWD/node_modules/.bin/:$PATH" ''; -} +} \ No newline at end of file