1
0
mirror of https://github.com/pyscript/pyscript.git synced 2022-05-01 19:47:48 +03:00

move guidGenerator to utils to make it more available

This commit is contained in:
Fabio Pliger
2022-04-22 12:03:04 -05:00
parent 9d0837abec
commit 1be8aa3a28
2 changed files with 9 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
import { pyodideLoaded, loadedEnvironments, componentDetailsNavOpen, mode } from '../stores';
import { guidGenerator } from '../utils';
// Premise used to connect to the first available pyodide interpreter
let pyodideReadyPromise;
let environments;
@@ -27,13 +27,6 @@ type PyodideInterface = {
registerJsModule(name: string, module: object): void
}
export function guidGenerator(): string {
var S4 = function(): string {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
};
return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
}
export class BaseEvalElement extends HTMLElement {
shadow: ShadowRoot;
wrapper: HTMLElement;

View File

@@ -34,4 +34,11 @@ function ltrim(code: string): string {
return code
}
export {addClasses, getLastPath, ltrim, htmlDecode}
function guidGenerator(): string {
var S4 = function(): string {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
};
return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
}
export {addClasses, getLastPath, ltrim, htmlDecode, guidGenerator}