From 5a4b84ac80ca025e1b75f677d6450f345d6c4114 Mon Sep 17 00:00:00 2001 From: sinclair Date: Fri, 27 Dec 2024 01:13:02 +0900 Subject: [PATCH] Tests --- example/index.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/example/index.ts b/example/index.ts index ee8cd778..00624abb 100644 --- a/example/index.ts +++ b/example/index.ts @@ -5,23 +5,3 @@ import { Parse, StaticParseAsType } from '@sinclair/typebox/syntax' import { Type, TypeGuard, Kind, Static, TSchema } from '@sinclair/typebox' const A = Type.String({ format: 'ipv4' }) - -const S = "!#$%&'*+/=?^_`{|}~-" - -function shuffleString(str: string) { - // Convert the string into an array of characters - const arr = str.split('') - - // Fisher-Yates (or Knuth) shuffle algorithm - for (let i = arr.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)) - - // Swap the elements at index i and j - ;[arr[i], arr[j]] = [arr[j], arr[i]] - } - - // Join the array back into a string and return it - return arr.join('') -} - -console.log(shuffleString(S))