From 014378e920c274d917b43625b283872925f4655b Mon Sep 17 00:00:00 2001 From: Lucas Alves Costa <50385918+luckasnix@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:26:10 -0300 Subject: [PATCH] docs: organize the structure based on MDN documentation (#58) --- docs/object-graph.doc.md | 52 ++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/docs/object-graph.doc.md b/docs/object-graph.doc.md index 34ca19f..ae66236 100644 --- a/docs/object-graph.doc.md +++ b/docs/object-graph.doc.md @@ -3,116 +3,122 @@ ## Constructor +### ObjectGraph() + Returns an instance of ObjectGraph. -### Parameters +#### Parameters | Name | Type | Default | Description | | --- | --- | --- | --- | | nodeValues | `Array` | - | __Required.__ The array of objects to generate the nodes of the graph. | | keyExtractor | `(nodeValue: NodeValue) => string` | - | __Required.__ The function to generate a key for each node. | -## length +## Instance Properties + +### length Returns the length of the object graph. -## keys() +## Instance Methods + +### keys() Returns an iterator object that contains the keys of the object graph. -## values() +### values() Returns an iterator object that contains the values of the object graph. -## get() +### get() Returns a node of the object graph. -### Parameters +#### Parameters | Name | Type | Default | Description | | --- | --- | --- | --- | | nodeKey | `string` | - | __Required.__ The key of the node to return from the object graph. | -## copy() +### copy() Returns a copy of the original object graph. -## add() +### add() Adds a node to the object graph. -### Parameters +#### Parameters | Name | Type | Default | Description | | --- | --- | --- | --- | | nodeValue | `NodeValue` | - | __Required.__ The value of the node to add to the object graph. | -## toAdded() +### toAdded() Returns a copy of the original object graph with a received node added. -### Parameters +#### Parameters | Name | Type | Default | Description | | --- | --- | --- | --- | | nodeValue | `NodeValue` | - | __Required.__ The value of the node to add to the object graph. | -## update() +### update() Updates a node in the object graph. -### Parameters +#### Parameters | Name | Type | Default | Description | | --- | --- | --- | --- | | nodeValue | `NodeValue` | - | __Required.__ The value of the node to update in the object graph. | -## toUpdated() +### toUpdated() Returns a copy of the original object graph with a received node updated. -### Parameters +#### Parameters | Name | Type | Default | Description | | --- | --- | --- | --- | | nodeValue | `NodeValue` | - | __Required.__ The value of the node to update in the object graph. | -## remove() +### remove() Removes a node from the object graph. -### Parameters +#### Parameters | Name | Type | Default | Description | | --- | --- | --- | --- | | nodeKey | `string` | - | __Required.__ The key of the node to remove from the object graph. | -## toRemoved() +### toRemoved() Returns a copy of the original object graph with a received node removed. -### Parameters +#### Parameters | Name | Type | Default | Description | | --- | --- | --- | --- | | nodeKey | `string` | - | __Required.__ The key of the node to remove from the object graph. | -## valuesOf() +### valuesOf() Returns all values of the provided property. -### Parameters +#### Parameters | Name | Type | Default | Description | | --- | --- | --- | --- | | propertyKey | `keyof NodeValue` | - | __Required.__ The property key of the node values to return from the object graph. | -## match() +### match() Returns all nodes that match with the provided shape. -### Parameters +#### Parameters | Name | Type | Default | Description | | --- | --- | --- | --- |