Skip to content

Commit 388429f

Browse files
committed
docs: rebuild docs
1 parent 3ed0355 commit 388429f

Some content is hidden

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

91 files changed

+3914
-1694
lines changed

packages/core/docs/variables/ERClassComponentFlag.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
### None
1414

15-
> **None**: `bigint`
15+
> **None**: `bigint` = `0n`
1616
1717
### PureComponent
1818

packages/core/docs/variables/ERFunctionComponentFlag.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
2121
### None
2222

23-
> **None**: `bigint`
23+
> **None**: `bigint` = `0n`

packages/tools/docs/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
- [isPromiseLike](functions/isPromiseLike.md)
7878
- [isReadonlyRecord](functions/isReadonlyRecord.md)
7979
- [isRecord](functions/isRecord.md)
80+
- [isRegExp](functions/isRegExp.md)
8081
- [isSet](functions/isSet.md)
8182
- [isString](functions/isString.md)
8283
- [isSymbol](functions/isSymbol.md)

packages/tools/docs/functions/and.md

+84-4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ Combines two predicates into a new predicate that returns `true` if both of the
5151

5252
**that**: [`Refinement`](../interfaces/Refinement.md)\<`A`, `C`\>
5353

54+
A predicate.
55+
5456
### Returns
5557

5658
`Function`
@@ -75,7 +77,20 @@ A predicate.
7577

7678
A predicate.
7779

78-
### Example
80+
### Examples
81+
82+
```ts
83+
import { Predicate } from "effect"
84+
85+
const minLength = (n: number) => (s: string) => s.length >= n
86+
const maxLength = (n: number) => (s: string) => s.length <= n
87+
88+
const length = (n: number) => Predicate.and(minLength(n), maxLength(n))
89+
90+
assert.deepStrictEqual(length(2)("aa"), true)
91+
assert.deepStrictEqual(length(2)("a"), false)
92+
assert.deepStrictEqual(length(2)("aaa"), false)
93+
```
7994

8095
```ts
8196
import { Predicate } from "effect"
@@ -94,6 +109,10 @@ assert.deepStrictEqual(length(2)("aaa"), false)
94109

95110
2.0.0
96111

112+
### Since
113+
114+
2.0.0
115+
97116
## and(self, that)
98117

99118
> **and**\<`A`, `B`, `C`\>(`self`, `that`): [`Refinement`](../interfaces/Refinement.md)\<`A`, `B` & `C`\>
@@ -112,8 +131,12 @@ Combines two predicates into a new predicate that returns `true` if both of the
112131

113132
**self**: [`Refinement`](../interfaces/Refinement.md)\<`A`, `B`\>
114133

134+
A predicate.
135+
115136
**that**: [`Refinement`](../interfaces/Refinement.md)\<`A`, `C`\>
116137

138+
A predicate.
139+
117140
### Returns
118141

119142
[`Refinement`](../interfaces/Refinement.md)\<`A`, `B` & `C`\>
@@ -126,7 +149,20 @@ A predicate.
126149

127150
A predicate.
128151

129-
### Example
152+
### Examples
153+
154+
```ts
155+
import { Predicate } from "effect"
156+
157+
const minLength = (n: number) => (s: string) => s.length >= n
158+
const maxLength = (n: number) => (s: string) => s.length <= n
159+
160+
const length = (n: number) => Predicate.and(minLength(n), maxLength(n))
161+
162+
assert.deepStrictEqual(length(2)("aa"), true)
163+
assert.deepStrictEqual(length(2)("a"), false)
164+
assert.deepStrictEqual(length(2)("aaa"), false)
165+
```
130166

131167
```ts
132168
import { Predicate } from "effect"
@@ -145,6 +181,10 @@ assert.deepStrictEqual(length(2)("aaa"), false)
145181

146182
2.0.0
147183

184+
### Since
185+
186+
2.0.0
187+
148188
## and(that)
149189

150190
> **and**\<`A`\>(`that`): (`self`) => [`Predicate`](../interfaces/Predicate.md)\<`A`\>
@@ -159,6 +199,8 @@ Combines two predicates into a new predicate that returns `true` if both of the
159199

160200
**that**: [`Predicate`](../interfaces/Predicate.md)\<`A`\>
161201

202+
A predicate.
203+
162204
### Returns
163205

164206
`Function`
@@ -179,7 +221,20 @@ A predicate.
179221

180222
A predicate.
181223

182-
### Example
224+
### Examples
225+
226+
```ts
227+
import { Predicate } from "effect"
228+
229+
const minLength = (n: number) => (s: string) => s.length >= n
230+
const maxLength = (n: number) => (s: string) => s.length <= n
231+
232+
const length = (n: number) => Predicate.and(minLength(n), maxLength(n))
233+
234+
assert.deepStrictEqual(length(2)("aa"), true)
235+
assert.deepStrictEqual(length(2)("a"), false)
236+
assert.deepStrictEqual(length(2)("aaa"), false)
237+
```
183238

184239
```ts
185240
import { Predicate } from "effect"
@@ -198,6 +253,10 @@ assert.deepStrictEqual(length(2)("aaa"), false)
198253

199254
2.0.0
200255

256+
### Since
257+
258+
2.0.0
259+
201260
## and(self, that)
202261

203262
> **and**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/Predicate.md)\<`A`\>
@@ -212,8 +271,12 @@ Combines two predicates into a new predicate that returns `true` if both of the
212271

213272
**self**: [`Predicate`](../interfaces/Predicate.md)\<`A`\>
214273

274+
A predicate.
275+
215276
**that**: [`Predicate`](../interfaces/Predicate.md)\<`A`\>
216277

278+
A predicate.
279+
217280
### Returns
218281

219282
[`Predicate`](../interfaces/Predicate.md)\<`A`\>
@@ -226,7 +289,20 @@ A predicate.
226289

227290
A predicate.
228291

229-
### Example
292+
### Examples
293+
294+
```ts
295+
import { Predicate } from "effect"
296+
297+
const minLength = (n: number) => (s: string) => s.length >= n
298+
const maxLength = (n: number) => (s: string) => s.length <= n
299+
300+
const length = (n: number) => Predicate.and(minLength(n), maxLength(n))
301+
302+
assert.deepStrictEqual(length(2)("aa"), true)
303+
assert.deepStrictEqual(length(2)("a"), false)
304+
assert.deepStrictEqual(length(2)("aaa"), false)
305+
```
230306

231307
```ts
232308
import { Predicate } from "effect"
@@ -244,3 +320,7 @@ assert.deepStrictEqual(length(2)("aaa"), false)
244320
### Since
245321

246322
2.0.0
323+
324+
### Since
325+
326+
2.0.0

packages/tools/docs/functions/compose.md

+16
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242

4343
2.0.0
4444

45+
### Since
46+
47+
2.0.0
48+
4549
## compose(bc)
4650

4751
> **compose**\<`A`, `B`\>(`bc`): (`ab`) => [`Refinement`](../interfaces/Refinement.md)\<`A`, `B`\>
@@ -72,6 +76,10 @@
7276

7377
2.0.0
7478

79+
### Since
80+
81+
2.0.0
82+
7583
## compose(ab, bc)
7684

7785
> **compose**\<`A`, `B`, `C`\>(`ab`, `bc`): [`Refinement`](../interfaces/Refinement.md)\<`A`, `C`\>
@@ -98,6 +106,10 @@
98106

99107
2.0.0
100108

109+
### Since
110+
111+
2.0.0
112+
101113
## compose(ab, bc)
102114

103115
> **compose**\<`A`, `B`\>(`ab`, `bc`): [`Refinement`](../interfaces/Refinement.md)\<`A`, `B`\>
@@ -121,3 +133,7 @@
121133
### Since
122134

123135
2.0.0
136+
137+
### Since
138+
139+
2.0.0

packages/tools/docs/functions/eqv.md

+8
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838

3939
2.0.0
4040

41+
### Since
42+
43+
2.0.0
44+
4145
## eqv(self, that)
4246

4347
> **eqv**\<`A`\>(`self`, `that`): [`Predicate`](../interfaces/Predicate.md)\<`A`\>
@@ -59,3 +63,7 @@
5963
### Since
6064

6165
2.0.0
66+
67+
### Since
68+
69+
2.0.0

packages/tools/docs/functions/hasProperty.md

+14
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Checks whether a value is an `object` containing a specified property key.
3434

3535
**property**: `P`
3636

37+
The field to check within the object.
38+
3739
### Returns
3840

3941
`Function`
@@ -58,6 +60,10 @@ The value to examine.
5860

5961
2.0.0
6062

63+
### Since
64+
65+
2.0.0
66+
6167
## hasProperty(self, property)
6268

6369
> **hasProperty**\<`P`\>(`self`, `property`): `self is { [K in PropertyKey]: unknown }`
@@ -72,8 +78,12 @@ Checks whether a value is an `object` containing a specified property key.
7278

7379
**self**: `unknown`
7480

81+
The value to examine.
82+
7583
**property**: `P`
7684

85+
The field to check within the object.
86+
7787
### Returns
7888

7989
`self is { [K in PropertyKey]: unknown }`
@@ -89,3 +99,7 @@ The value to examine.
8999
### Since
90100

91101
2.0.0
102+
103+
### Since
104+
105+
2.0.0

packages/tools/docs/functions/implies.md

+52-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ must be true.
9797

9898
[`Predicate`](../interfaces/Predicate.md)\<`A`\>
9999

100-
### Example
100+
### Examples
101101

102102
```ts
103103
import { Predicate } from "effect"
@@ -120,6 +120,31 @@ assert.equal(transitivity({ a: 1, b: 2, c: 3 }), true)
120120
assert.equal(transitivity({ a: 1, b: 0, c: 0 }), true)
121121
```
122122

123+
```ts
124+
import { Predicate } from "effect"
125+
126+
type Triple = {
127+
readonly a: number
128+
readonly b: number
129+
readonly c: number
130+
}
131+
132+
const transitivity = Predicate.implies(
133+
// antecedent
134+
(input: Triple) => input.a <= input.b && input.b <= input.c,
135+
// consequent
136+
(input: Triple) => input.a <= input.c
137+
)
138+
139+
assert.equal(transitivity({ a: 1, b: 2, c: 3 }), true)
140+
// antecedent is `false`, so the result is `true`
141+
assert.equal(transitivity({ a: 1, b: 0, c: 0 }), true)
142+
```
143+
144+
### Since
145+
146+
2.0.0
147+
123148
### Since
124149

125150
2.0.0
@@ -162,7 +187,7 @@ must be true.
162187

163188
[`Predicate`](../interfaces/Predicate.md)\<`A`\>
164189

165-
### Example
190+
### Examples
166191

167192
```ts
168193
import { Predicate } from "effect"
@@ -185,6 +210,31 @@ assert.equal(transitivity({ a: 1, b: 2, c: 3 }), true)
185210
assert.equal(transitivity({ a: 1, b: 0, c: 0 }), true)
186211
```
187212

213+
```ts
214+
import { Predicate } from "effect"
215+
216+
type Triple = {
217+
readonly a: number
218+
readonly b: number
219+
readonly c: number
220+
}
221+
222+
const transitivity = Predicate.implies(
223+
// antecedent
224+
(input: Triple) => input.a <= input.b && input.b <= input.c,
225+
// consequent
226+
(input: Triple) => input.a <= input.c
227+
)
228+
229+
assert.equal(transitivity({ a: 1, b: 2, c: 3 }), true)
230+
// antecedent is `false`, so the result is `true`
231+
assert.equal(transitivity({ a: 1, b: 0, c: 0 }), true)
232+
```
233+
234+
### Since
235+
236+
2.0.0
237+
188238
### Since
189239

190240
2.0.0

0 commit comments

Comments
 (0)