chore(deps): switched to fucking ts v5

This commit is contained in:
Corentin Thomasset 2023-08-21 21:51:53 +02:00
parent 815e7da60f
commit 8d25ec2686
No known key found for this signature in database
GPG key ID: DBD997E935996158
10 changed files with 1041 additions and 807 deletions

View file

@ -18,7 +18,7 @@ function computeVariance({ data }: { data: number[] }) {
return computeAverage({ data: squaredDiffs });
}
function arrayToMarkdownTable({ data, headerMap = {} }: { data: unknown[]; headerMap?: Record<string, string> }) {
function arrayToMarkdownTable({ data, headerMap = {} }: { data: Record<string, unknown>[]; headerMap?: Record<string, string> }) {
if (!Array.isArray(data) || data.length === 0) {
return '';
}

View file

@ -5,4 +5,4 @@ export type EmojiInfo = {
emoji: string
codePoints: string | undefined
unicode: string
} & typeof emojiUnicodeData['\uD83E\uDD10'];
} & typeof emojiUnicodeData[string];

View file

@ -15,14 +15,12 @@ export function createToken({
length?: number
alphabet?: string
}) {
const allAlphabet
= alphabet
?? [
...(withUppercase ? 'ABCDEFGHIJKLMOPQRSTUVWXYZ' : ''),
...(withLowercase ? 'abcdefghijklmopqrstuvwxyz' : ''),
...(withNumbers ? '0123456789' : ''),
...(withSymbols ? '.,;:!?./-"\'#{([-|\\@)]=}*+' : ''),
].join('');
const allAlphabet = alphabet ?? [
withUppercase ? 'ABCDEFGHIJKLMOPQRSTUVWXYZ' : '',
withLowercase ? 'abcdefghijklmopqrstuvwxyz' : '',
withNumbers ? '0123456789' : '',
withSymbols ? '.,;:!?./-"\'#{([-|\\@)]=}*+' : '',
].join(''); ;
return shuffleString(allAlphabet.repeat(length)).substring(0, length);
}