Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AzatCoder committed Jul 22, 2022
1 parent 7c6c6a1 commit b5f481a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
15 changes: 15 additions & 0 deletions index.html
Expand Up @@ -392,6 +392,7 @@
<li data-name="toPath">- <a href="#toPath">toPath</a></li>
<li data-name="has">- <a href="#has">has</a></li>
<li data-name="get">- <a href="#get">get</a></li>
<li data-name="set">- <a href="#set">set</a></li>
<li data-name="property">- <a href="#property">property</a></li>
<li data-name="propertyOf">- <a href="#propertyOf">propertyOf</a></li>
<li data-name="matcher">- <a href="#matcher">matcher</a></li>
Expand Down Expand Up @@ -1951,6 +1952,20 @@ <h2 id="objects">Object Functions</h2>
=&gt; 2
_.get({a: 10}, 'b', 100);
=&gt; 100
</pre>

<p id="set">
<b class="header">set</b><code>_.set(object, path, value)</code><br>
Sets the value on <b>path</b> of <b>object</b>. <b>path</b> may be
specified as a simple key, or as an array of object keys or array
indexes. If the property does not exist, it will be created.
Returns mutated <b>object</b>.
</p>
<pre>
_.set({a: 10}, 'a', 50);
=&gt; {a: 50}
_.set({a: 10}, ['b', 0, 'value'], 50);
=&gt; {a: 10, b: [{value: 50}]}
</pre>

<p id="has">
Expand Down
2 changes: 1 addition & 1 deletion modules/set.js
Expand Up @@ -24,7 +24,7 @@ function deepSet(obj, path, value) {

// Set the value on `path` of `object`.
// If any property in `path` does not exist it will be created.
// Returns mutated object (the first argument `obj`).
// Returns mutated object (`obj`).
export default function set(obj, path, value) {
path = toPath(path);

Expand Down
2 changes: 1 addition & 1 deletion underscore-esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion underscore-node-f.cjs
Expand Up @@ -857,7 +857,7 @@ function deepSet(obj, path, value) {

// Set the value on `path` of `object`.
// If any property in `path` does not exist it will be created.
// Returns mutated object (the first argument `obj`).
// Returns mutated object (`obj`).
function set(obj, path, value) {
path = toPath(path);

Expand Down
2 changes: 1 addition & 1 deletion underscore-umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b5f481a

Please sign in to comment.