style: configure deno fmt to use single quotes
- Add singleQuote: true to deno.json fmt configuration - Reformat all files with single quotes using deno fmt
This commit is contained in:
@@ -1 +1 @@
|
||||
export * from './shortid.ts';
|
||||
export * from './shortid.ts';
|
||||
|
@@ -5,11 +5,11 @@
|
||||
export function shortId(): string {
|
||||
// Define the character set: a-z, A-Z, 0-9
|
||||
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
|
||||
|
||||
// Generate cryptographically secure random values
|
||||
const randomValues = new Uint8Array(6);
|
||||
crypto.getRandomValues(randomValues);
|
||||
|
||||
|
||||
// Map each random value to a character in our set
|
||||
let result = '';
|
||||
for (let i = 0; i < 6; i++) {
|
||||
@@ -17,6 +17,6 @@ export function shortId(): string {
|
||||
const index = randomValues[i] % chars.length;
|
||||
result += chars[index];
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user