Skip to content

Commit f65bd8e

Browse files
committed
docs: update getGridDimensions notes
1 parent 6992e7e commit f65bd8e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/aoc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A collection handler functions for manipulating regular arrays.
2525
A collection of convenience handler functions for AoC 2D input arrays.
2626

2727
- **`getCoordinateSymbol()`** - Converts a 2D `Point` point object to a string and returns its value from the 2D array
28-
- **`getGridDimensions()`** - Retrieves the length and width of a 2D string or number array
28+
- **`getGridDimensions()`** - Retrieves the length and width of a generic 2D array
2929
- **`isIllegalCoordinate()`** - Checks if a point at coordinate (y,x) in a grid is illegal: if it's out of bounds of the grid area or if its symbol differs from the symbol parameter.
3030
- **`isOutOfBounds()`** - Checks if a (y,x) coordinate is out of the grid area
3131
- **`getDiagonalNeighbors()`** - Retrieves the four (4) diagonally aligned (y,x) coordinates and the symbol character from a `Point` in the grid. Substitutes a `"*"` symbol character in the `PointSymbol.symbol`if the `point` is out of the grid bounds.

src/aoc/grid/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export const getCoordinateSymbol = (point: Point, data: number[][] | string[][])
2222
}
2323

2424
/**
25-
* Retrieves the length and width of a 2D string or number array
26-
* @param {string[][] | number[][]} data - 2D string or number array
25+
* Retrieves the length and width of a generic 2D array
26+
* @param {T[][] | T[][]} data - 2D array, usually `string[][]`, `number[][]` or others.
2727
* @returns {GridDimensions} Object containig the length and width of the 2D array
2828
*/
2929
export const getGridDimensions = <T>(data: T[][]): GridDimensions => {

0 commit comments

Comments
 (0)