Skip to content

Commit 669fb68

Browse files
committed
💡 Add Comments to Exported Functions
1 parent 4e11a40 commit 669fb68

File tree

3 files changed

+31
-17
lines changed

3 files changed

+31
-17
lines changed

LICENSE.md

+11-12
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22

33
Copyright (c) 2021 Eliaz Bobadilla
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
1111

1212
The above copyright notice and this permission notice shall be included in all
1313
copies or substantial portions of the Software.
1414

1515
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
![Lines Of Code](https://img.shields.io/tokei/lines/github.com/UltiRequiem/fibonacci-deno?color=blue&label=Total%20Lines)
66
![CodeQL](https://github.com/UltiRequiem/fibonacci-deno/workflows/CodeQL/badge.svg)
77

8-
Port of [fibonacci-go](https://github.com/UltiRequiem/fibonacci) for [Deno](https://deno.land).
8+
Port of [fibonacci-go](https://github.com/UltiRequiem/fibonacci) for
9+
[Deno](https://deno.land).
910

1011
> Utilities for the Fibonacci Number and Sequence
1112
1213
## Usage
1314

14-
This package exposes two Functions, [fibonacci](https://github.com/UltiRequiem/fibonacci-deno/blob/main/mod.ts#L1) and [fibonacciSequence](https://github.com/UltiRequiem/fibonacci-deno/blob/main/mod.ts#L15).
15+
This package exposes two Functions,
16+
[fibonacci](https://github.com/UltiRequiem/fibonacci-deno/blob/main/mod.ts#L1)
17+
and
18+
[fibonacciSequence](https://github.com/UltiRequiem/fibonacci-deno/blob/main/mod.ts#L15).
1519

1620
```typescript
1721
import {
@@ -63,4 +67,5 @@ $ fibonacci --number 3
6367

6468
### License
6569

66-
[This package](https://deno.land/x/fibonacci) is licensed under the [MIT License](./LICENSE.md).
70+
[This package](https://deno.land/x/fibonacci) is licensed under the
71+
[MIT License](./LICENSE.md).

mod.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
export function fibonacci(n: number) {
1+
/**
2+
* Returns the Nth Fibonacci Number
3+
* @param n The Nth Fibonacci Number you want to get
4+
* @returns The Nth Fibonacci Number
5+
*/
6+
export function fibonacci(n: number): number {
27
if (n < 0) {
38
throw new Error(`Expected a number bigger than zero, but got ${n}.`);
49
}
@@ -12,7 +17,12 @@ export function fibonacci(n: number) {
1217

1318
fibonacci.cache = [0, 1, 1];
1419

15-
export function fibonacciSequence(length: number) {
20+
/**
21+
* Return an Array with the first N numbers of the Fibonacci Sequence
22+
* @param length The length of the array you want to get
23+
* @returns The Array with the first N numbers of the Fibonacci Sequence
24+
*/
25+
export function fibonacciSequence(length: number): number[] {
1626
const sequence = [];
1727

1828
for (let i = 0; i < length; i++) {

0 commit comments

Comments
 (0)