Skip to content

Commit 8fca230

Browse files
committed
chore: updated docs
1 parent 514f63b commit 8fca230

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+982
-442
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules/
22
dist/
33
yarn-error.log
44
docs/modules/*.ts.md
5-
docs/_site
5+
docs/_sitedocs
6+
docs/

src/Alpha.ts

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1+
/**
2+
* @since 1.0.0
3+
*/
14
import * as t from "io-ts";
25
import isAlpha from "validator/lib/isAlpha";
36

4-
/*
5-
* @categorty type
7+
/**
68
* @since 1.0.0
79
*/
8-
interface AlphaBrand {
10+
export interface AlphaBrand {
911
readonly Alpha: unique symbol;
1012
}
1113

12-
/*
14+
/**
1315
* @categorty type
1416
* @since 1.0.0
1517
*/
16-
type Alpha = t.Branded<string, AlphaBrand>;
18+
export type Alpha = t.Branded<string, AlphaBrand>;
1719

18-
/*
19-
20-
* A string that only includes alpha characters. E.g. a, b, c, A, B, C
21-
*
22-
* @categorty codec
23-
* @since 1.0. 0
20+
/**
21+
* @since 1.0.0
2422
*/
25-
const Alpha = t.brand(t.string, (s): s is Alpha => isAlpha(s), "Alpha");
23+
export const Alpha = t.brand(t.string, (s): s is Alpha => isAlpha(s), "Alpha");
2624

27-
export { Alpha, AlphaBrand };
2825
export default Alpha;

src/AlphaNumeric.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1+
/**
2+
* @since 1.0.0
3+
*/
14
import * as t from "io-ts";
25
import isAlphaNumeric from "validator/lib/isAlphanumeric";
36

4-
interface AlphaNumericBrand {
7+
/**
8+
* @since 1.0.0
9+
*/
10+
export interface AlphaNumericBrand {
511
readonly AlphaNumeric: unique symbol;
612
}
713

8-
type AlphaNumeric = t.Branded<string, AlphaNumericBrand>;
9-
const AlphaNumeric = t.brand(t.string, (s): s is AlphaNumeric => isAlphaNumeric(s), "AlphaNumeric");
14+
/**
15+
* @since 1.0.0
16+
*/
17+
export type AlphaNumeric = t.Branded<string, AlphaNumericBrand>;
18+
19+
/**
20+
* @since 1.0.0
21+
*/
22+
export const AlphaNumeric = t.brand(t.string, (s): s is AlphaNumeric => isAlphaNumeric(s), "AlphaNumeric");
1023

11-
export { AlphaNumeric, AlphaNumericBrand };
1224
export default AlphaNumeric;

src/Ascii.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
1+
/**
2+
* @since 1.0.0
3+
*/
14
import * as t from "io-ts";
25
import isAscii from "validator/lib/isAscii";
36

4-
interface AsciiBrand {
7+
8+
/**
9+
* @since 1.0.0
10+
*/
11+
export interface AsciiBrand {
512
readonly Ascii: unique symbol;
613
}
714

8-
type Ascii = t.Branded<string, AsciiBrand>;
9-
const Ascii = t.brand(t.string, (s): s is Ascii => isAscii(s), "Ascii");
15+
/**
16+
* @since 1.0.0
17+
*/
18+
export type Ascii = t.Branded<string, AsciiBrand>;
19+
20+
/**
21+
* @since 1.0.0
22+
*/
23+
export const Ascii = t.brand(t.string, (s): s is Ascii => isAscii(s), "Ascii");
1024

11-
export { Ascii, AsciiBrand };
1225
export default Ascii;

src/BIC.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1+
/**
2+
* @since 1.0.0
3+
*/
14
import * as t from 'io-ts'
25
import isBIC from 'validator/lib/isBIC'
36

4-
interface BICBrand {
7+
/**
8+
* @since 1.0.0
9+
*/
10+
export interface BICBrand {
511
readonly BIC: unique symbol
612
}
713

8-
type BIC = t.Branded<string, BICBrand>
9-
const BIC = t.brand(t.string, (s): s is BIC => isBIC(s), 'BIC')
14+
/**
15+
* @since 1.0.0
16+
*/
17+
export type BIC = t.Branded<string, BICBrand>
18+
19+
/**
20+
* @since 1.0.0
21+
*/
22+
export const BIC = t.brand(t.string, (s): s is BIC => isBIC(s), 'BIC')
1023

11-
export { BIC, BICBrand }
1224
export default BIC

src/Base.ts

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @since 1.0.0
3+
*/
14
import * as t from "io-ts";
25
import isBase32 from "validator/lib/isBase32";
36
import 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

5175
export default Base32;

src/BitcoinAddress.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1+
/**
2+
* @since 1.0.0
3+
*/
14
import * as t from "io-ts";
25
import isBtcAddress from "validator/lib/isBtcAddress";
36

4-
interface BitcoinAddressBrand {
7+
/**
8+
* @since 1.0.0
9+
*/
10+
export interface BitcoinAddressBrand {
511
readonly BitcoinAddress: unique symbol;
612
}
713

8-
type BitcoinAddress = t.Branded<string, BitcoinAddressBrand>;
14+
/**
15+
* @since 1.0.0
16+
*/
17+
export type BitcoinAddress = t.Branded<string, BitcoinAddressBrand>;
918

10-
const BitcoinAddress = t.brand(
19+
/**
20+
* @since 1.0.0
21+
*/
22+
export const BitcoinAddress = t.brand(
1123
t.string,
1224
(s): s is BitcoinAddress => isBtcAddress(s),
1325
"BitcoinAddress"
1426
);
1527

1628

17-
export { BitcoinAddress, BitcoinAddressBrand }
1829
export default BitcoinAddress;

src/Char.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
1+
/**
2+
* A string of length one. E.g. "a
3+
* "
4+
*
5+
* @since 1.0.0
6+
*/
17
import * as t from "io-ts";
28
import isLength from "validator/lib/isLength";
39

4-
/*
5-
* Char - A string of length one
10+
/**
11+
* @since 1.0.0
612
*/
7-
8-
interface CharBrand {
13+
export interface CharBrand {
914
readonly Char: unique symbol;
1015
}
1116

12-
type Char = t.Branded<string, CharBrand>;
17+
/**
18+
* @since 1.0.0
19+
*/
20+
export type Char = t.Branded<string, CharBrand>;
1321

14-
const Char = t.brand(
22+
/**
23+
* @since 1.0.0
24+
*/
25+
export const Char = t.brand(
1526
t.string,
1627
(s): s is Char => isLength(s, { min: 1, max: 1 }),
1728
"Char"
1829
);
1930

2031

21-
export { Char, CharBrand }
2232
export default Char;

0 commit comments

Comments
 (0)