Skip to content

Commit 77d3aaf

Browse files
committed
add EndOfEarlyData
1 parent a2ecb1e commit 77d3aaf

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tls/enum",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"exports": "./src/mod.ts",
55
"publish": {
66
"exclude": ["dist/"]

src/handshaketype.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,15 @@ export class Handshake extends Uint8Array {
134134
}
135135
}
136136

137+
export class EndOfEarlyData extends Uint8Array {
138+
static fromHandshake(array){
139+
const type = HandshakeType.fromValue(array.at(0));
140+
if(type!==HandshakeType.END_OF_EARLY_DATA) return TypeError(`Expected ${HandshakeType.END_OF_EARLY_DATA.name}`)
141+
return new EndOfEarlyData
142+
}
143+
constructor(){
144+
super()
145+
}
146+
}
147+
137148
// npx -p typescript tsc ./src/handshaketype.js --declaration --allowJs --emitDeclarationOnly --lib ESNext --outDir ./dist

0 commit comments

Comments
 (0)