mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
860353474a
* Got request moving working but is pretty messy * Can now drag between groups * Minor stuff * Prevent deletion of last workspace * Fixed some things * Copy-pasta RequestGroup drag-n-drop * Closes #2
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;
|
|
}
|