mirror of https://github.com/grafana/grafana.git
				
				
				
			
		
			
	
	
		
			27 lines
		
	
	
		
			558 B
		
	
	
	
		
			JavaScript
		
	
	
	
		
		
			
		
	
	
			27 lines
		
	
	
		
			558 B
		
	
	
	
		
			JavaScript
		
	
	
	
| 
								 | 
							
								define([], function() {
							 | 
						||
| 
								 | 
							
								  'use strict';
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  return {
							 | 
						||
| 
								 | 
							
								    get: function(key) {
							 | 
						||
| 
								 | 
							
								      return window.localStorage[key];
							 | 
						||
| 
								 | 
							
								    },
							 | 
						||
| 
								 | 
							
								    set: function(key, value) {
							 | 
						||
| 
								 | 
							
								      window.localStorage[key] = value;
							 | 
						||
| 
								 | 
							
								    },
							 | 
						||
| 
								 | 
							
								    getBool: function(key, def) {
							 | 
						||
| 
								 | 
							
								      if (def !== void 0 && !this.exists(key)) {
							 | 
						||
| 
								 | 
							
								        return def;
							 | 
						||
| 
								 | 
							
								      }
							 | 
						||
| 
								 | 
							
								      return window.localStorage[key] === 'true' ? true : false;
							 | 
						||
| 
								 | 
							
								    },
							 | 
						||
| 
								 | 
							
								    exists: function(key) {
							 | 
						||
| 
								 | 
							
								      return window.localStorage[key] !== void 0;
							 | 
						||
| 
								 | 
							
								    },
							 | 
						||
| 
								 | 
							
								    delete: function(key) {
							 | 
						||
| 
								 | 
							
								      window.localStorage.removeItem(key);
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  };
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								});
							 |