Skip to content

Commit b4f0f4d

Browse files
author
Mark Lagendijk
committed
Added documentation
1 parent 385752c commit b4f0f4d

File tree

2 files changed

+127
-18
lines changed

2 files changed

+127
-18
lines changed

README.md

Lines changed: 112 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,113 @@
1-
lodash.deep
2-
===========
3-
1+
# lodash.deep
42
Lodash mixins for (deep) object accessing / manipulation.
3+
4+
## Installation
5+
1. `bower install lodash.deep`
6+
2. Reference `lodash.deep.min.js` after `lodash.min.js`
7+
8+
## Docs
9+
10+
### _.deepIn(object, propertyPath)
11+
Executes a deep check for the existence of a property in an object tree.
12+
13+
#### object
14+
Type: `Object`
15+
16+
The root object of the object tree.
17+
18+
#### propertyPath
19+
Type: `string`
20+
21+
The dot separated propertyPath.
22+
23+
#### returns
24+
Type: `boolean`
25+
26+
### _.deepHas(object, propertyPath)
27+
Executes a deep check for the existence of a *own* property in an object tree.
28+
29+
#### object
30+
Type: `Object`
31+
32+
The root object of the object tree.
33+
34+
#### propertyPath
35+
Type: `string`
36+
37+
The dot separated propertyPath.
38+
39+
#### returns
40+
Type: `boolean`
41+
42+
### _.deepGetValue(object, propertyPath)
43+
Retreives the value of a property in an object tree.
44+
45+
#### object
46+
Type: `Object`
47+
48+
The root object of the object tree.
49+
50+
#### propertyPath
51+
Type: `string`
52+
53+
The dot separated propertyPath.
54+
55+
#### returns
56+
Type: `*|undefined`
57+
58+
The value, or undefined if it doesn't exists.
59+
60+
### _.deepGetOwnValue(object, propertyPath)
61+
Retreives the value of a *own* property in an object tree.
62+
63+
#### object
64+
Type: `Object`
65+
66+
The root object of the object tree.
67+
68+
#### propertyPath
69+
Type: `string`
70+
71+
The dot separated propertyPath.
72+
73+
#### returns
74+
Type: `*|undefined`
75+
76+
The value, or undefined if it doesn't exists.
77+
78+
### _.deepSetValue(object, propertyPath, value)
79+
Executes a deep check for the existence of a own property in an object tree.
80+
81+
#### object
82+
Type: `Object`
83+
84+
The root object of the object tree.
85+
86+
#### propertyPath
87+
Type: `string`
88+
89+
The dot separated propertyPath.
90+
91+
#### value
92+
Type: `*`
93+
94+
The value to set.
95+
96+
#### returns
97+
Type: `Object`
98+
99+
### _.deepPluck(collection, propertyPath)
100+
Executes a deep pluck on an collection of object trees.
101+
102+
#### collection
103+
Type: `Object|Array`
104+
105+
The collection of object trees.
106+
107+
#### propertyPath
108+
Type: `string`
109+
110+
The dot separated propertyPath.
111+
112+
#### returns
113+
Type: `Object|Array`

lodash.deep.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
_.mixin({
1010
/**
1111
* Executes a deep check for the existence of a property in an object tree.
12-
* @param object - The root object of the object tree.
13-
* @param propertyPath - The dot separated propertyPath.
12+
* @param {Object} object - The root object of the object tree.
13+
* @param {string} propertyPath - The dot separated propertyPath.
1414
* @returns {boolean}
1515
*/
1616
deepIn: function(object, propertyPath){
@@ -29,8 +29,8 @@
2929
},
3030
/**
3131
* Executes a deep check for the existence of a own property in an object tree.
32-
* @param object - The root object of the object tree.
33-
* @param propertyPath - The dot separated propertyPath.
32+
* @param {Object} object - The root object of the object tree.
33+
* @param {string} propertyPath - The dot separated propertyPath.
3434
* @returns {boolean}
3535
*/
3636
deepHas: function(object, propertyPath){
@@ -49,8 +49,8 @@
4949
},
5050
/**
5151
* Retreives the value of a property in an object tree.
52-
* @param object - The root object of the object tree.
53-
* @param propertyPath - The dot separated propertyPath.
52+
* @param {Object} object - The root object of the object tree.
53+
* @param {string} propertyPath - The dot separated propertyPath.
5454
* @returns {*} - The value, or undefined if it doesn't exists.
5555
*/
5656
deepGetValue: function(object, propertyPath){
@@ -65,8 +65,8 @@
6565
},
6666
/**
6767
* Retreives the own value of a property in an object tree.
68-
* @param object - The root object of the object tree.
69-
* @param propertyPath - The dot separated propertyPath.
68+
* @param {Object} object - The root object of the object tree.
69+
* @param {string} propertyPath - The dot separated propertyPath.
7070
* @returns {*} - The value, or undefined if it doesn't exists.
7171
*/
7272
deepGetOwnValue: function(object, propertyPath){
@@ -81,10 +81,10 @@
8181
},
8282
/**
8383
* Sets a value of a property in an object tree. Any missing objects will be created.
84-
* @param object - The root object of the object tree.
85-
* @param propertyPath - The dot separated propertyPath.
86-
* @param value - The value to set.
87-
* @returns {*}
84+
* @param {Object} object - The root object of the object tree.
85+
* @param {string} propertyPath - The dot separated propertyPath.
86+
* @param {*} value - The value to set.
87+
* @returns {Object} The object.
8888
*/
8989
deepSetValue: function(object, propertyPath, value){
9090
var properties, property, currentObject;
@@ -106,9 +106,9 @@
106106
},
107107
/**
108108
* Executes a deep pluck on an collection of object trees.
109-
* @param collection - The collection of object trees.
110-
* @param propertyPath - The dot separated propertyPath.
111-
* @returns {Array}
109+
* @param {Object|Array} collection - The collection of object trees.
110+
* @param {string} propertyPath - The dot separated propertyPath.
111+
* @returns {Object|Array}
112112
*/
113113
deepPluck: function(collection, propertyPath){
114114
return _.map(collection, function(item){

0 commit comments

Comments
 (0)