-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove uuid dependency and replace with randomString for un…
…ique key generation
- Loading branch information
1 parent
120d68e
commit 3f14769
Showing
8 changed files
with
19 additions
and
30 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,6 @@ | |
"devDependencies": { | ||
"@types/jest": "^29.5.14", | ||
"@types/node": "^22.10.7", | ||
"@types/uuid": "^10.0.0", | ||
"azure-translator-code": "^1.1.6", | ||
"dotenv": "^16.4.7", | ||
"eslint": "^8", | ||
|
@@ -62,8 +61,5 @@ | |
"ts-node": "^10.9.2", | ||
"typescript": "^5.7.3" | ||
}, | ||
"packageManager": "[email protected]", | ||
"dependencies": { | ||
"uuid": "^11" | ||
} | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function randomString() { | ||
return (Math.random() * 3).toString(36); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import randomString from "../../src/randomString"; | ||
|
||
describe("randomString", () => { | ||
it("should return a random string", () => { | ||
const generateRandomString = randomString(); | ||
|
||
expect(typeof generateRandomString).toBe("string"); | ||
expect(generateRandomString).not.toBeNull(); | ||
expect(generateRandomString).not.toBeUndefined(); | ||
expect(generateRandomString).not.toBe(""); | ||
expect(generateRandomString.trim()).not.toBe(""); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters