/** 
 * @author Robert Strutts <Robert@TryingToScale.com>
 * @copyright Copyright (c) 2022, Robert Strutts.
 * @license https://mit-license.org/
 */

var Fresh = function() {
    function KeepAsset(key) {
        found_one = false;
        assets_files.forEach(value => {
           if (ajax_folder+value.filename+value.ts == key) {
                found_one = true;
                // Note: Do NOT use a BREAK here it will not work
                // NOR does Return work 
           }
        });
        return found_one;
    }

   let allKeys = Object.keys(localStorage); 
   allKeys.forEach(value => {
        if (! KeepAsset(value)) {
            localStorage.removeItem(value);
        }
    });
};

tts.Router.get('Clear', function() {
    sessionStorage.clear();
});
