Skip to content

Commit d91a3dc

Browse files
committed
🎉 feat: release 1.4.10
1 parent 8603eb4 commit d91a3dc

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
# 1.4.10
1+
# 1.4.10 - 9 Oct 2025
22
Bug fix:
3+
- static handlers in Bun 1.3
4+
- conditional use `crypto` randomUUID if not available (eg. iOS Safari)
5+
36
Change:
47
- `Elysia.file` readstream value is now IIFE to re-read
58

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "elysia",
33
"description": "Ergonomic Framework for Human",
4-
"version": "1.4.10-beta.0",
4+
"version": "1.4.10",
55
"author": {
66
"name": "saltyAom",
77
"url": "https://github.com/SaltyAom",

src/utils.ts

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -950,10 +950,26 @@ export const form = <const T extends Record<keyof any, unknown>>(
950950
return formData as any
951951
}
952952

953-
export const randomId = () => {
954-
const uuid = crypto.randomUUID()
955-
return uuid.slice(0, 8) + uuid.slice(24, 32)
956-
}
953+
export const randomId =
954+
typeof crypto === 'undefined'
955+
? () => {
956+
let result = ''
957+
958+
const characters =
959+
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
960+
const charactersLength = characters.length
961+
962+
for (let i = 0; i < 16; i++)
963+
result += characters.charAt(
964+
Math.floor(Math.random() * charactersLength)
965+
)
966+
967+
return result
968+
}
969+
: () => {
970+
const uuid = crypto.randomUUID()
971+
return uuid.slice(0, 8) + uuid.slice(24, 32)
972+
}
957973

958974
// ! Deduplicate current instance
959975
export const deduplicateChecksum = <T extends Function>(
@@ -1080,10 +1096,7 @@ export const supportPerMethodInlineHandler = (() => {
10801096

10811097
if (Bun.semver?.satisfies?.(Bun.version, '>=1.2.14')) return true
10821098

1083-
const semver = Bun.version.split('.')
1084-
if (+semver[0] < 1 || +semver[1] < 2 || +semver[2] < 14) return false
1085-
1086-
return true
1099+
return false
10871100
})()
10881101

10891102
type FormatSSEPayload<T = unknown> = T extends string

0 commit comments

Comments
 (0)