mirror of
				https://github.com/strapi/strapi.git
				synced 2025-11-04 03:43:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			347 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			347 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
'use strict';
 | 
						|
 | 
						|
class LocalStorageMock {
 | 
						|
  constructor() {
 | 
						|
    this.store = {};
 | 
						|
  }
 | 
						|
 | 
						|
  clear() {
 | 
						|
    this.store = {};
 | 
						|
  }
 | 
						|
 | 
						|
  getItem(key) {
 | 
						|
    return this.store[key] || null;
 | 
						|
  }
 | 
						|
 | 
						|
  setItem(key, value) {
 | 
						|
    this.store[key] = String(value);
 | 
						|
  }
 | 
						|
 | 
						|
  removeItem(key) {
 | 
						|
    delete this.store[key];
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
global.localStorage = new LocalStorageMock();
 |