Skip to content

Commit

Permalink
Incremented to v.0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Boyko committed Mar 18, 2021
1 parent f1bcf1d commit 1dc0350
Show file tree
Hide file tree
Showing 57 changed files with 1,246 additions and 1,205 deletions.
39 changes: 20 additions & 19 deletions documentation/array/cartesianProduct.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@

## cartesianProduct

#### import

```typescript
import cartesianProduct from "https://deno.land/x/[email protected].1/src/array/cartesianProduct.ts";
import cartesianProduct from "https://deno.land/x/[email protected].2/src/array/cartesianProduct.ts"
```

#### signature

```typescript
cartesianProduct = <T, U>(a: T[], b: U[]): [T, U][]
```
Takes two arrays of type T and type U respectively, and creates an array of
tuple type [T, U] for every combination of the elements of a and b.
Takes two arrays of type T and type U respectively, and creates an array of tuple type [T, U] for every combination of the elements of a and b.
#### Source:
Expand All @@ -29,22 +27,25 @@ export const cartesianProduct = <T, U>(a: T[], b: U[]): [T, U][] => {
};

export default cartesianProduct;

```

#### Test Examples:
#### Test Examples:

```typescript
Rhum.testSuite("cartesianProduct()", () => {
Rhum.testCase(
"Should calculate the cartesian product of two arrays",
() => {
Rhum.asserts.assertEquals(cartesianProduct(["x", "y"], [1, 2]), [
["x", 1],
["x", 2],
["y", 1],
["y", 2],
]);
},
);
});
Rhum.testSuite("cartesianProduct()", () => {
Rhum.testCase(
"Should calculate the cartesian product of two arrays",
() => {
Rhum.asserts.assertEquals(cartesianProduct(["x", "y"], [1, 2]), [
["x", 1],
["x", 2],
["y", 1],
["y", 2],
]);
},
);
});
```


10 changes: 6 additions & 4 deletions documentation/array/chunk.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

## chunk

#### import

```typescript
import chunk from "https://deno.land/x/[email protected].1/src/array/chunk.ts";
import chunk from "https://deno.land/x/[email protected].2/src/array/chunk.ts"
```

#### signature

```typescript
chunk = <T>(arr: T[], size: number = 1): T[][]
```
Expand All @@ -29,9 +28,10 @@ export const chunk = <T>(arr: T[], size = 1): T[][] => {
};

export default chunk;

```

#### Test Examples:
#### Test Examples:

```typescript
Rhum.testSuite("chunk()", () => {
Expand Down Expand Up @@ -70,3 +70,5 @@ Rhum.testSuite("chunk()", () => {
});
});
```


14 changes: 7 additions & 7 deletions documentation/array/chunkIntoParts.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@

## chunkIntoParts

#### import

```typescript
import chunkIntoParts from "https://deno.land/x/[email protected].1/src/array/chunkIntoParts.ts";
import chunkIntoParts from "https://deno.land/x/[email protected].2/src/array/chunkIntoParts.ts"
```

#### signature

```typescript
chunkIntoParts = <T>(arr: T[], parts = 1): T[][]
```
Takes an array (arr) and splits it into multiple parts (parts) of equal size.
For example: an array of length 10 split into 3 parts would be split into 4, 4,
and 2 parts
Takes an array (arr) and splits it into multiple parts (parts) of equal size. For example: an array of length 10 split into 3 parts would be split into 4, 4, and 2 parts
#### Source:
Expand All @@ -27,9 +24,10 @@ export const chunkIntoParts = <T>(arr: T[], parts = 1): T[][] => {
};

export default chunkIntoParts;

```

#### Test Examples:
#### Test Examples:

```typescript
Rhum.testSuite("chunkIntoParts()", () => {
Expand Down Expand Up @@ -91,3 +89,5 @@ Rhum.testSuite("chunkIntoParts()", () => {
});
});
```


13 changes: 7 additions & 6 deletions documentation/array/difference.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@

## difference

#### import

```typescript
import difference from "https://deno.land/x/[email protected].1/src/array/difference.ts";
import difference from "https://deno.land/x/[email protected].2/src/array/difference.ts"
```

#### signature

```typescript
difference = <T>(a: T[], b: T[]): T[]
```
Takes two arrays (a, b) and returns an array of elements in a that do not exist
in b
Takes two arrays (a, b) and returns an array of elements in a that do not exist in b
#### Source:
Expand All @@ -25,9 +23,10 @@ export const difference = <T>(a: T[], b: T[]): T[] =>
differenceBy(identity, a, b);

export default difference;

```

#### Test Examples:
#### Test Examples:

```typescript
Rhum.testSuite("difference()", () => {
Expand All @@ -38,3 +37,5 @@ Rhum.testSuite("difference()", () => {
});
});
```


15 changes: 7 additions & 8 deletions documentation/array/differenceBy.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@

## differenceBy

#### import

```typescript
import differenceBy from "https://deno.land/x/[email protected].1/src/array/differenceBy.ts";
import differenceBy from "https://deno.land/x/[email protected].2/src/array/differenceBy.ts"
```

#### signature

```typescript
differenceBy = <T>(iteratee: Iteratee<T, any>, a: T[], b: T[]): T[]
```
Takes two arrays (a, b) and an iteratee. It returns an array of elements in a
where the return of iteratee(a) does not equal any return of the map of b over
iteratee. In other words, after running the function on both, remove any
elements where iteratee(a) matches any iteratee(b)
Takes two arrays (a, b) and an iteratee. It returns an array of elements in a where the return of iteratee(a) does not equal any return of the map of b over iteratee. In other words, after running the function on both, remove any elements where iteratee(a) matches any iteratee(b)
#### Source:
Expand All @@ -38,9 +34,10 @@ export const differenceBy = <T>(
};

export default differenceBy;

```

#### Test Examples:
#### Test Examples:

```typescript
Rhum.testSuite("differenceBy()", () => {
Expand All @@ -51,3 +48,5 @@ Rhum.testSuite("differenceBy()", () => {
});
});
```


14 changes: 7 additions & 7 deletions documentation/array/differenceWith.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

## differenceWith

#### import

```typescript
import differenceWith from "https://deno.land/x/[email protected].1/src/array/differenceWith.ts";
import differenceWith from "https://deno.land/x/[email protected].2/src/array/differenceWith.ts"
```

#### signature

```typescript
differenceWith = <T>(
comparator: Comparator<T>,
Expand All @@ -16,9 +15,7 @@ differenceWith = <T>(
)
```

Takes two arrays (a, b) and a comparator (which will return a boolean). It
returns an array of elements in a where no element in b returns true for
comparator(elemA, elemB)
Takes two arrays (a, b) and a comparator (which will return a boolean). It returns an array of elements in a where no element in b returns true for comparator(elemA, elemB)

#### Source:

Expand All @@ -40,9 +37,10 @@ export const differenceWith = <T>(
};

export default differenceWith;

```

#### Test Examples:
#### Test Examples:

```typescript
Rhum.testSuite("differenceWith()", () => {
Expand Down Expand Up @@ -71,3 +69,5 @@ Rhum.testSuite("differenceWith()", () => {
});
});
```


17 changes: 8 additions & 9 deletions documentation/array/dropWhile.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@

## dropWhile

#### import

```typescript
import dropWhile from "https://deno.land/x/[email protected].1/src/array/dropWhile.ts";
import dropWhile from "https://deno.land/x/[email protected].2/src/array/dropWhile.ts"
```

#### signature

```typescript
dropWhile = <T>(
arr: T[],
predicate: Predicate<T>,
): T[]
): T[]
```

Takes an array (arr) and a Predicate (predicate) which will return boolean. It
iterates over the array and will drop (or more accurately, not copy) all
elements until it reaches an element where predicate(element) returns false. It
returns a new array.
Takes an array (arr) and a Predicate (predicate) which will return boolean. It iterates over the array and will drop (or more accurately, not copy) all elements until it reaches an element where predicate(element) returns false. It returns a new array.

#### Source:

Expand All @@ -38,9 +34,10 @@ export const dropWhile = <T>(
};

export default dropWhile;

```

#### Test Examples:
#### Test Examples:

```typescript
Rhum.testSuite("dropWhile()", () => {
Expand All @@ -56,3 +53,5 @@ Rhum.testSuite("dropWhile()", () => {
);
});
```


16 changes: 7 additions & 9 deletions documentation/array/dropWhileRight.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@

## dropWhileRight

#### import

```typescript
import dropWhileRight from "https://deno.land/x/[email protected].1/src/array/dropWhileRight.ts";
import dropWhileRight from "https://deno.land/x/[email protected].2/src/array/dropWhileRight.ts"
```

#### signature

```typescript
dropWhileRight = <T>(
arr: T[],
predicate: Predicate<T>,
): T[]
```

Takes an array (arr) and a Predicate (predicate) which will return boolean. It
iterates over the array starting from the last element in the array, towards the
first element, and will drop (or more accurately, not copy) all elements until
it reaches an element where predicate(element) returns false. It returns a new
array.
Takes an array (arr) and a Predicate (predicate) which will return boolean. It iterates over the array starting from the last element in the array, towards the first element, and will drop (or more accurately, not copy) all elements until it reaches an element where predicate(element) returns false. It returns a new array.

#### Source:

Expand All @@ -39,9 +34,10 @@ export const dropWhileRight = <T>(
};

export default dropWhileRight;

```

#### Test Examples:
#### Test Examples:

```typescript
Rhum.testSuite("dropWhileRight()", () => {
Expand All @@ -57,3 +53,5 @@ Rhum.testSuite("dropWhileRight()", () => {
);
});
```


Loading

0 comments on commit 1dc0350

Please sign in to comment.