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:
@@ -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;
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user