1+ /**
2+ * @since 1.0.0
3+ */
14import * as t from "io-ts" ;
25import isBase32 from "validator/lib/isBase32" ;
36import isBase58 from "validator/lib/isBase58" ;
@@ -7,45 +10,66 @@ import isBase64 from "validator/lib/isBase64";
710 * Base 32 Encoded
811 */
912
10- interface Base32Brand {
13+ /**
14+ * @since 1.0.0
15+ */
16+ export interface Base32Brand {
1117 readonly Base32 : unique symbol ;
1218}
1319
14- type Base32 = t . Branded < string , Base32Brand > ;
15- const Base32 = t . brand ( t . string , ( s ) : s is Base32 => isBase32 ( s ) , "Base32" ) ;
20+ /**
21+ * @since 1.0.0
22+ */
23+ export type Base32 = t . Branded < string , Base32Brand > ;
24+
25+ /**
26+ * @since 1.0.0
27+ */
28+ export const Base32 = t . brand ( t . string , ( s ) : s is Base32 => isBase32 ( s ) , "Base32" ) ;
1629
1730
1831/*
1932 * Base 58 Encoded
2033 */
2134
22- interface Base58Brand {
35+ /**
36+ * @since 1.0.0
37+ */
38+ export interface Base58Brand {
2339 readonly Base58 : unique symbol ;
2440}
2541
26- type Base58 = t . Branded < string , Base58Brand > ;
27- const Base58 = t . brand ( t . string , ( s ) : s is Base58 => isBase58 ( s ) , "Base58" ) ;
42+ /**
43+ * @since 1.0.0
44+ */
45+ export type Base58 = t . Branded < string , Base58Brand > ;
46+
47+ /**
48+ * @since 1.0.0
49+ */
50+ export const Base58 = t . brand ( t . string , ( s ) : s is Base58 => isBase58 ( s ) , "Base58" ) ;
2851
2952
3053/*
3154 * Base 64 Encoded
3255 */
3356
34- interface Base64Brand {
57+ /**
58+ * @since 1.0.0
59+ */
60+ export interface Base64Brand {
3561 readonly Base64 : unique symbol ;
3662}
3763
38- type Base64 = t . Branded < string , Base64Brand > ;
39- const Base64 = t . brand ( t . string , ( s ) : s is Base64 => isBase64 ( s ) , "Base64" ) ;
64+ /**
65+ * @since 1.0.0
66+ */
67+ export type Base64 = t . Branded < string , Base64Brand > ;
4068
69+ /**
70+ * @since 1.0.0
71+ */
72+ export const Base64 = t . brand ( t . string , ( s ) : s is Base64 => isBase64 ( s ) , "Base64" ) ;
4173
42- export {
43- Base32 ,
44- Base32Brand ,
45- Base58 ,
46- Base58Brand ,
47- Base64 ,
48- Base64Brand
49- }
5074
5175export default Base32 ;
0 commit comments