From 7b0626012df0e3652226c664f7cf395081301690 Mon Sep 17 00:00:00 2001 From: Calvin Date: Tue, 2 Jul 2019 21:55:09 -1000 Subject: [PATCH 1/3] vault --- vault.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/vault.js b/vault.js index e899cce..d16420d 100644 --- a/vault.js +++ b/vault.js @@ -1,4 +1,17 @@ 'use strict'; module.exports = function() { - + let newKey = ''; + let newValue = ''; + return { + setValue: function(key, value){ + newKey = key; + newValue = value; + }, + getValue: function(key){ + if (!key || key !== newKey){ + return null; + } + return newValue; + } + } }; \ No newline at end of file From 80c039f82fff1cefa6486837b4ad8715445b4ac2 Mon Sep 17 00:00:00 2001 From: Calvin Date: Wed, 3 Jul 2019 14:41:18 -1000 Subject: [PATCH 2/3] minor --- vault.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vault.js b/vault.js index d16420d..0cd84d6 100644 --- a/vault.js +++ b/vault.js @@ -1,7 +1,7 @@ 'use strict'; module.exports = function() { - let newKey = ''; - let newValue = ''; + let newKey; + let newValue; return { setValue: function(key, value){ newKey = key; From cb3e6d9c3ed5d57cb12dc68febac97c6db9f6965 Mon Sep 17 00:00:00 2001 From: Calvin Date: Wed, 3 Jul 2019 14:45:23 -1000 Subject: [PATCH 3/3] minor --- vault.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vault.js b/vault.js index 0cd84d6..16a7109 100644 --- a/vault.js +++ b/vault.js @@ -14,4 +14,4 @@ module.exports = function() { return newValue; } } -}; \ No newline at end of file +} \ No newline at end of file