Skip to content

Commit

Permalink
docs(api): #15 complete
Browse files Browse the repository at this point in the history
  • Loading branch information
mahabubx7 committed Oct 20, 2024
1 parent 791230e commit 3711924
Show file tree
Hide file tree
Showing 9 changed files with 2,773 additions and 69 deletions.
24 changes: 12 additions & 12 deletions docs/api/array.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ Our array schema is always dependent on others. Becasue, array is a collection o
## Table of Contents

- [Schema & Validators](#schema-and-validators)
- [unique](#unique)
- [min](#min)
- [max](#max)
- [range](#range)
- [objects](#objects)
- [enums](#enums)
- [unique](#unique)
- [min](#min)
- [max](#max)
- [range](#range)
- [objects](#objects)
- [enums](#enums)
- [Conclusion](#conclusion)

## Schema and Validators

### Unique `.unique()`
## `.unique()`

This validator is used to check if the array has unique values or not. If the array has duplicate values, it will return an error.

Expand Down Expand Up @@ -91,7 +91,7 @@ console.log(resultOne, resultTow)

:::

### Min `.min()`
## `.min()`

This validator is used to check if the array has a minimum number of elements or not. If the array has fewer elements than the specified number, it will return an error.

Expand Down Expand Up @@ -159,7 +159,7 @@ console.log(resultOne, resultTow)

:::

### Max `.max()`
## `.max()`

This validator is used to check if the array has a maximum number of elements or not. If the array has more elements than the specified number, it will return an error.

Expand Down Expand Up @@ -227,7 +227,7 @@ console.log(resultOne, resultTow)

:::

### Range `.range()`
## `.range()`

This validator is used to check if the array has a range of elements or not. If the array has fewer or more elements than the specified range, it will return an error.

Expand Down Expand Up @@ -295,7 +295,7 @@ console.log(resultOne, resultTow)

:::

### Objects
## Objects

This validator is used to check if the array has a specific object schema or not. If the array has an object that does not match the specified schema, it will return an error.

Expand Down Expand Up @@ -399,7 +399,7 @@ You can also use the `min`, `max`, `range` validators with this object based sch
:::
### Enums
## Enums
This validator is used to check if the array has specific values or not. If the array has a value that is not in the specified list, it will return an error.
Expand Down
8 changes: 4 additions & 4 deletions docs/api/boolean.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ Boolean is a data type that can have one of two values: `true` or `false`.
## Table of Contents

- [Schema & Validators](#schema--validators)
- [default](#default)
- [exact](#exact)
- [default](#default)
- [exact](#exact)
- [Conclusion](#conclusion)

## Schema & Validators

### default
## default

By default, the boolean schema does not have any validators. It only checks if the value is a boolean.

Expand Down Expand Up @@ -51,7 +51,7 @@ console.log(resultOne, resultTow)
{ value: false }
```
### exact `.exact(value: boolean)`
## `.exact(value: boolean)`
The `exact` validator checks if the value is exactly equal to the provided value.
Expand Down
4 changes: 2 additions & 2 deletions docs/api/enum.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Enum is a data type that can have one of a specific set of values. It is similar
## Table of Contents

- [Schema & Validators](#schema--validators)
- [default](#default)
- [default](#default)
- [Conclusion](#conclusion)

## Schema & Validators
Expand Down Expand Up @@ -81,7 +81,7 @@ console.log(resultOne, resultTow, resultThree, resultFour)
:::
### default `.default(value: string)`
## `.default(value: string)`
The `default` validator sets the default value of the schema if the value is `undefined`.
Expand Down
11 changes: 8 additions & 3 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

Welcome to the `Akar.js`. This page will walk you through the available API references of this library.

::: info
Work in progress ⏳
:::
## Table of Contents

- [Array](/api/array)
- [Object](/api/object)
- [String](/api/string)
- [Number](/api/number)
- [Enum](/api/enum)
- [Boolean](/api/boolean)
64 changes: 32 additions & 32 deletions docs/api/number.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ You can define a schema of a number using the `a.number()` method. This method w
## Table of Contents

- [Schema & Validators](#schema-and-validators)
- [min](#min)
- [max](#max)
- [range](#range)
- [integer](#integer)
- [float](#float)
- [unsigned](#unsigned)
- [signed](#signed)
- [odd](#odd)
- [even](#even)
- [divisibleBy](#divisibleby)
- [port](#port)
- [binary](#binary)
- [octal](#octal)
- [hex](#hex)
- [prime](#prime)
- [perfect](#perfect)
- [min](#min)
- [max](#max)
- [range](#range)
- [integer](#integer)
- [float](#float)
- [unsigned](#unsigned)
- [signed](#signed)
- [odd](#odd)
- [even](#even)
- [divisibleBy](#divisibleby)
- [port](#port)
- [binary](#binary)
- [octal](#octal)
- [hex](#hex)
- [prime](#prime)
- [perfect](#perfect)
- [Conclusion](#conclusion)

## Schema and Validators

### min `.min(value: number)`
## `.min(value: number)`

This validator is used to check if the number is greater than or equal to the specified value.

Expand Down Expand Up @@ -72,7 +72,7 @@ console.log(resultOne, resultTow)
}
```
### max `.max(value: number)`
## `.max(value: number)`
This validator is used to check if the number is less than or equal to the specified value.
Expand Down Expand Up @@ -117,7 +117,7 @@ console.log(resultOne, resultTow)
}
```
### range `.range(min: number, max: number)`
## `.range(min: number, max: number)`
This validator is used to check if the number is within the specified range.
Expand Down Expand Up @@ -162,7 +162,7 @@ console.log(resultOne, resultTow)
}
```
### integer `.integer()`
## `.integer()`
This validator is used to check if the number is an integer.
Expand Down Expand Up @@ -207,7 +207,7 @@ console.log(resultOne, resultTow)
}
```
### float `.float()`
## `.float()`
This validator is used to check if the number is a float.
Expand Down Expand Up @@ -252,7 +252,7 @@ console.log(resultOne, resultTow)
}
```
### unsigned `.unsigned()`
## `.unsigned()`
This validator is used to check if the number is an unsigned number.
Expand Down Expand Up @@ -297,7 +297,7 @@ console.log(resultOne, resultTow)
}
```
### signed `.signed()`
## `.signed()`
This validator is used to check if the number is a signed number.
Expand Down Expand Up @@ -342,7 +342,7 @@ console.log(resultOne, resultTow)
}
```
### odd `.odd()`
## `.odd()`
This validator is used to check if the number is an odd number.
Expand Down Expand Up @@ -387,7 +387,7 @@ console.log(resultOne, resultTow)
}
```
### even `.even()`
## `.even()`
This validator is used to check if the number is an even number.
Expand Down Expand Up @@ -432,7 +432,7 @@ console.log(resultOne, resultTow)
}
```
### divisibleBy `.divisibleBy(value: number)`
## `.divisibleBy(value: number)`
This validator is used to check if the number is divisible by the specified value.
Expand Down Expand Up @@ -477,7 +477,7 @@ console.log(resultOne, resultTow)
}
```
### port `.port()`
## `.port()`
This validator is used to check if the number is a valid port number.
Expand Down Expand Up @@ -523,7 +523,7 @@ console.log(resultOne, resultTow)
}
```
### binary `.binary()`
## `.binary()`
This validator is used to check if the number is a valid binary number.
Expand Down Expand Up @@ -568,7 +568,7 @@ console.log(resultOne, resultTow)
}
```
### octal `.octal()`
## `.octal()`
This validator is used to check if the number is a valid octal number.
Expand Down Expand Up @@ -613,7 +613,7 @@ console.log(resultOne, resultTow)
}
```
### hex `.hex()`
## `.hex()`
This validator is used to check if the number is a valid hexadecimal number.
Expand Down Expand Up @@ -658,7 +658,7 @@ console.log(resultOne, resultTow)
}
```
### prime `.prime()`
## `.prime()`
This validator is used to check if the number is a prime number.
Expand Down Expand Up @@ -703,7 +703,7 @@ console.log(resultOne, resultTow)
}
```
### perfect `.perfect()`
## `.perfect()`
This validator is used to check if the number is a perfect number.
Expand Down
16 changes: 8 additions & 8 deletions docs/api/object.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ The `Object` class is the base class for all objects in the game. It provides a
## Table of Contents

- [Schema & Validators](#schema-and-validators)
- [EqualTo](#equal-to)
- [DeepEqualTo](#not-equal-to)
- [ShallowEqualTo](#shallow-equal-to)
- [JsonObject](#json-object)
- [EqualTo](#equal-to)
- [DeepEqualTo](#not-equal-to)
- [ShallowEqualTo](#shallow-equal-to)
- [JsonObject](#json-object)
- [Conclusion](#conclusion)

## Schema and Validators

### EqualTo `.equalTo()`
## `.equalTo()`

This validator is used to check if the object is equal to the provided object or not. If the object is not equal to the provided object, it will return an error.

Expand Down Expand Up @@ -88,7 +88,7 @@ console.log(resultOne, resultTow)
}
```
### DeepEqualTo `.deepEqualTo()`
## `.deepEqualTo()`
This validator is used to check if the object is deeply equal to the provided object or not. If the object is not deeply equal to the provided object, it will return an error.
Expand Down Expand Up @@ -163,7 +163,7 @@ console.log(resultOne, resultTow)
}
```
### ShallowEqualTo `.shallowEqualTo()`
## `.shallowEqualTo()`
This validator is used to check if the object is shallowly equal to the provided object or not. If the object is not shallowly equal to the provided object, it will return an error.
Expand Down Expand Up @@ -238,7 +238,7 @@ console.log(resultOne, resultTow)
}
```
### JsonObject `.jsonObject()`
## `.jsonObject()`
This validator is used to check if the object is a valid JSON object or not. If the object is not a valid JSON object, it will return an error.
Expand Down
Loading

0 comments on commit 3711924

Please sign in to comment.