mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
e9d64ebb23
* Got a hacky workspace implementation running * Removed some hax with reducer composition * Moved some more around * Moved files back out * Started on entities reducer * Split up some components * Moved nested modules back out of workspaces * Started on new Sidebar tree stuff * Better store stuff * Some more tweaks * Removed workspace update action * Re-implemented filtering in the Sidbare * Switch to get the newest response
14 lines
354 B
JavaScript
14 lines
354 B
JavaScript
|
|
// NOTE: hard-to-distinguish characters have been remove like 0, o, O, etc...
|
|
const CHARS = '23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ'.split('');
|
|
|
|
export function generateId (prefix) {
|
|
let id = `${prefix}/${Date.now()}/`;
|
|
|
|
for (let i = 0; i < 13; i++) {
|
|
id += CHARS[Math.floor(Math.random() * CHARS.length)];
|
|
}
|
|
|
|
return id;
|
|
}
|