Skip to content

Commit

Permalink
docs: add a description to the constructor (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
luckasnix authored Jul 2, 2024
1 parent d3b934d commit 2717b2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/object-graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## Constructor

Instantiates an object graph.
Returns an instance of ObjectGraph.

### Parameters

Expand Down
3 changes: 3 additions & 0 deletions src/object-graph/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ export class ObjectGraph<NodeValue extends Record<string, unknown>> {
private nodes: Map<string, NodeValue>;
private keyExtractor: (nodeValue: NodeValue) => string;

/**
* @description Returns an instance of ObjectGraph.
*/
constructor(nodeValues: Array<NodeValue>, keyExtractor: (nodeValue: NodeValue) => string) {
if (!nodeValues) {
throw new Error("Provide a value for the 'nodeValues' parameter");
Expand Down

0 comments on commit 2717b2a

Please sign in to comment.