From e7d5033f8ee336c6c7d7013b8fb51f0017c94ca0 Mon Sep 17 00:00:00 2001 From: John Atkins Date: Sat, 17 Jun 2017 15:36:51 -1000 Subject: [PATCH 1/2] first iteration --- vault.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/vault.js b/vault.js index e899cce..3ac4c76 100644 --- a/vault.js +++ b/vault.js @@ -1,4 +1,19 @@ 'use strict'; module.exports = function() { - -}; \ No newline at end of file + + let vault = {}; + + module.setValue = function( key, value ){ + vault[key] = value; + } + + module.getValue = function ( key ){ + if (vault.hasOwnProperty(key)){ + return vault[key]; + } else { return null; } + } + + return module; + +}; + From 6c252385dcdd7c467e20050eb11a3b8b83024f11 Mon Sep 17 00:00:00 2001 From: John Atkins Date: Sat, 17 Jun 2017 19:27:05 -1000 Subject: [PATCH 2/2] DONE --- vault.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/vault.js b/vault.js index 3ac4c76..d819a5d 100644 --- a/vault.js +++ b/vault.js @@ -3,17 +3,18 @@ module.exports = function() { let vault = {}; - module.setValue = function( key, value ){ - vault[key] = value; - } + return { - module.getValue = function ( key ){ - if (vault.hasOwnProperty(key)){ - return vault[key]; - } else { return null; } - } + setValue : function( key, value ){ + vault[key] = value; + }, - return module; + getValue : function ( key ){ + if (vault.hasOwnProperty(key)){ + return vault[key]; + } else { return null; } + } + } };