github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/mirage/faker.js (about) 1 import faker from 'faker'; 2 import config from 'nomad-ui/config/environment'; 3 4 const searchIncludesSeed = window.location.search.includes('faker-seed'); 5 6 if (config.environment !== 'test' || searchIncludesSeed) { 7 if (searchIncludesSeed) { 8 const params = new URLSearchParams(window.location.search); 9 const seed = parseInt(params.get('faker-seed')); 10 faker.seed(seed); 11 } else { 12 faker.seed(1); 13 } 14 } 15 16 export default faker;