Skip to content

Commit 7f6899b

Browse files
committed
add Uint8 to ContentType.js
1 parent 8d0169d commit 7f6899b

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

deno.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tls/enum",
3-
"version": "0.2.6",
3+
"version": "0.2.7",
44
"exports": "./src/mod.ts",
55
"publish": {
66
"exclude": ["dist/"]
@@ -13,10 +13,9 @@
1313
}
1414
},
1515
"imports": {
16-
"@aicone/byte": "jsr:@aicone/byte@^0.5.0",
1716
"@noble/curves": "npm:@noble/curves@^1.6.0",
1817
"@std/assert": "jsr:@std/assert@^1.0.2",
19-
"@tls/extension": "jsr:@tls/extension@^0.1.2",
18+
"@tls/extension": "jsr:@tls/extension@^0.2.0",
2019
"@tls/struct": "jsr:@tls/struct@^0.2.6"
2120
}
2221
}

src/contentype.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// deno-lint-ignore-file no-slow-types
22
// @ts-self-types="../type/contentype.d.ts"
33

4+
import { Uint8 } from "./dep.ts";
45
import { Enum } from "./enum.js";
56

67

@@ -28,6 +29,10 @@ export class ContentType extends Enum {
2829
return ContentType.fromValue(octet[0]) ?? Error(`Unknown ${octet[0]} ContentType type`);
2930
}
3031

32+
get Uint8(){
33+
return Uint8.fromValue(+this)
34+
}
35+
3136
/**return 8 */
3237
get bit() { return 8 }
3338
}

type/contentype.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,9 @@ export class ContentType extends Enum {
2121
static from(octet: Uint8Array): ContentType;
2222
/**return 8 */
2323
get bit(): number;
24+
25+
/**return Uint8 */
26+
get Uint8(): Uint8
2427
}
28+
import { Uint8 } from "../src/dep.ts";
2529
import { Enum } from "../src/enum.js";

0 commit comments

Comments
 (0)