Simplify deep path doc examples. [ci skip]

This commit is contained in:
John-David Dalton
2016-04-05 08:44:14 -07:00
parent 6f3fb587e2
commit f0f6a1e382

View File

@@ -12092,16 +12092,16 @@
* @returns {boolean} Returns `true` if `path` exists, else `false`. * @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example * @example
* *
* var object = { 'a': { 'b': { 'c': 3 } } }; * var object = { 'a': { 'b': 2 } };
* var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); * var other = _.create({ 'a': _.create({ 'b': 2 }) });
* *
* _.has(object, 'a'); * _.has(object, 'a');
* // => true * // => true
* *
* _.has(object, 'a.b.c'); * _.has(object, 'a.b');
* // => true * // => true
* *
* _.has(object, ['a', 'b', 'c']); * _.has(object, ['a', 'b']);
* // => true * // => true
* *
* _.has(other, 'a'); * _.has(other, 'a');
@@ -12123,15 +12123,15 @@
* @returns {boolean} Returns `true` if `path` exists, else `false`. * @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example * @example
* *
* var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); * var object = _.create({ 'a': _.create({ 'b': 2 }) });
* *
* _.hasIn(object, 'a'); * _.hasIn(object, 'a');
* // => true * // => true
* *
* _.hasIn(object, 'a.b.c'); * _.hasIn(object, 'a.b');
* // => true * // => true
* *
* _.hasIn(object, ['a', 'b', 'c']); * _.hasIn(object, ['a', 'b']);
* // => true * // => true
* *
* _.hasIn(object, 'b'); * _.hasIn(object, 'b');
@@ -14527,14 +14527,14 @@
* @example * @example
* *
* var objects = [ * var objects = [
* { 'a': { 'b': { 'c': _.constant(2) } } }, * { 'a': { 'b': _.constant(2) } },
* { 'a': { 'b': { 'c': _.constant(1) } } } * { 'a': { 'b': _.constant(1) } }
* ]; * ];
* *
* _.map(objects, _.method('a.b.c')); * _.map(objects, _.method('a.b'));
* // => [2, 1] * // => [2, 1]
* *
* _.map(objects, _.method(['a', 'b', 'c'])); * _.map(objects, _.method(['a', 'b']));
* // => [2, 1] * // => [2, 1]
*/ */
var method = rest(function(path, args) { var method = rest(function(path, args) {
@@ -14787,14 +14787,14 @@
* @example * @example
* *
* var objects = [ * var objects = [
* { 'a': { 'b': { 'c': 2 } } }, * { 'a': { 'b': 2 } },
* { 'a': { 'b': { 'c': 1 } } } * { 'a': { 'b': 1 } }
* ]; * ];
* *
* _.map(objects, _.property('a.b.c')); * _.map(objects, _.property('a.b'));
* // => [2, 1] * // => [2, 1]
* *
* _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
* // => [1, 2] * // => [1, 2]
*/ */
function property(path) { function property(path) {