Skip to content

Commit

Permalink
Remove nanoid from common
Browse files Browse the repository at this point in the history
  • Loading branch information
IanPhilips committed Oct 21, 2024
1 parent 0a36bed commit 40dc5fb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"dayjs": "1.11.4",
"link-preview-js": "3.0.4",
"lodash": "4.17.21",
"nanoid": "^3.3.4",
"string-similarity": "4.0.4",
"zod": "3.21.4"
},
Expand Down
11 changes: 9 additions & 2 deletions common/src/bet.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { groupBy, mapValues } from 'lodash'
import { Fees } from './fees'
import { maxMinBin } from './chart'
import { nanoid } from 'nanoid'

/************************************************
Expand Down Expand Up @@ -102,4 +101,12 @@ export type maker = {
timestamp: number
}

export const getNewBetId = () => nanoid(12)
export const getNewBetId = () => {
const characters =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
let result = ''
for (let i = 0; i < 12; i++) {
result += characters.charAt(Math.floor(Math.random() * characters.length))
}
return result
}
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"dayjs": "1.11.4",
"firebase": "9.19.1",
"link-preview-js": "3.0.4",
"nanoid": "^3.3.4",
"nanoid": "3.3.7",
"next": "14.1.0",
"prosemirror-state": "1.4.2",
"punycode": "2.3.1",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9823,7 +9823,7 @@ mz@^2.7.0:
object-assign "^4.0.1"
thenify-all "^1.0.0"

nanoid@^3.3.4:
[email protected].7:
version "3.3.7"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8"
integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==
Expand Down

0 comments on commit 40dc5fb

Please sign in to comment.