vtu_createUsermain.tsx1 match
7import PBKDF2Hash from 'https://esm.town/v/rozek/vtu_PBKDF2Hash'
89export default async function createUser (
10UserId:string, Password:string, Roles:string = 'user'
11):Promise<void> {
vtu_ListOfUserIdsmain.tsx1 match
1import { blob } from "https://esm.town/v/std/blob"
23export default async function ListOfUserIds ():Promise<string[]> {
4return (await blob.list('vtu_User_')).map((Info:any) => Info.key.slice(9))
5}
vtu_TestSupportmain.tsx19 matches
6const SkipIndicator = '⏭️ [SKIP]: '
78let beforeEachFns:Function[] = []
9let afterEachFns:Function[] = []
10let beforeAllFns:Function[] = []
11let afterAllFns:Function[] = []
1213/**** describe ****/
1415export async function describe (
16CollectionName:string, Collection:Function
17):Promise<void> {
18const outerBeforeEachFns = beforeEachFns; beforeEachFns = []
41/**** xdescribe ****/
4243export async function xdescribe (
44CollectionName:string, Collection:Function
45):Promise<void> {
46console.log(SkipIndicator + CollectionName)
49/**** it ****/
5051export async function it (
52SpecName:string, Spec:Function, Timeout:number = 2000
53) {
54try {
73/**** xit ****/
7475export function xit (
76SpecName:string, Spec:Function, Timeout:number = 2000
77) {
78console.log(SkipIndicator + SpecName)
81/**** fail ****/
8283export function fail (Message:string):void {
84throw new Error(Message)
85}
87/**** before/afterAll/Each ****/
8889export function beforeAll (Handler:Function):void { beforeAllFns.push(Handler) }
90export function afterAll (Handler:Function):void { afterAllFns.push(Handler) }
91export function beforeEach(Handler:Function):void { beforeEachFns.push(Handler) }
92export function afterEach (Handler:Function):void { afterEachFns.push(Handler) }
93
94/**** runWithTimeout ****/
9596async function runWithTimeout(
97Handler:Function, Timeout:number
98):Promise<void> {
99return Promise.race([
sqliteExplorerAppREADME.md1 match
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
2import crypto from "node:crypto"
34export default async function vtu_generateJWTKeyPair ():Promise<void> {
5const { privateKey, publicKey } = crypto.generateKeyPairSync('ec', {
6namedCurve:'P-384',
vtu_JWTisValidmain.tsx1 match
8import { blob } from "https://esm.town/v/std/blob"
910export default async function JWTisValid (JWT:string):Promise<boolean> {
11expectNonEmptyString('JWT',JWT)
12
vtu_JWTformain.tsx1 match
8import { blob } from "https://esm.town/v/std/blob"
910export default async function JWTfor (
11User:string, Roles:string, Expiration:number = 3600
12) {
6const HashPattern = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?:\d+:(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
78export default async function PBKDF2HashMatches (
9PBKDF2Hash:string, Password:string
10):Promise<boolean> {
vtu_PBKDF2Hashmain.tsx1 match
5} from 'npm:javascript-interface-library'
67export default async function PBKDF2Hash (
8Password:string, Salt?:string, Iterations:number=10000
9):Promise<string> {
7const numPointsPerCircle = 200; // Set number of points per circle
89function gcd(a: number, b: number): number {
10return b === 0 ? a : gcd(b, a % b);
11}
1213function lcm(a: number, b: number): number {
14return (a * b) / gcd(a, b);
15}
1617function App() {
18const chartRef = useRef(null);
19const chartInstanceRef = useRef(null);
130}
131132function complexExp(t) {
133return { re: Math.cos(t), im: Math.sin(t) };
134}
135136function complexMult(a, b) {
137if (typeof b === "number") {
138return { re: a.re * b, im: a.im * b };
144}
145146function complexAdd(a, b) {
147return { re: a.re + b.re, im: a.im + b.im };
148}
149150function client() {
151createRoot(document.getElementById("root")).render(<App />);
152}
153if (typeof document !== "undefined") { client(); }
154155export default async function server(request: Request): Promise<Response> {
156return new Response(
157`