Skip to content

Commit a996bfe

Browse files
@stdlib/assert/deep-has-own-property: Pull request changes stdlib-js#2
1 parent aeb42ba commit a996bfe

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/node_modules/@stdlib/assert/deep-has-own-property/docs/repl.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
Examples
2525
--------
2626
> var obj = { 'a': { 'b': { 'c': 'd' } } };
27-
> var bool = {{alias}}( obj, 'a.b.c' );
27+
> var bool = {{alias}}( obj, 'a.b.c' )
2828
true
2929

3030
// Specify a custom separator via the `sep` option:
3131
> obj = { 'a': { 'b': { 'c': 'd' } } };
32-
> bool = {{alias}}( obj, 'a/b/c', { 'sep': '/' } );
32+
> bool = {{alias}}( obj, 'a/b/c', { 'sep': '/' } )
3333
true
3434

3535
{{alias}}.factory( path[, options] )
@@ -55,7 +55,7 @@
5555
--------
5656
> var has = {{alias}}.factory( 'a/b/c', { 'sep': '/' } );
5757
> var obj = { 'a': { 'b': { 'c': 'd' } } };
58-
> var bool = has( obj );
58+
> var bool = has( obj )
5959
true
6060

6161
See Also

lib/node_modules/@stdlib/assert/deep-has-own-property/lib/d_has_own.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,18 @@ var hasOwnProp = require( '@stdlib/assert/has-own-property' );
1818
*/
1919
function deepHasOwn( obj, props ) {
2020
var len = props.length;
21-
var hasOwn;
2221
var i;
2322
for ( i = 0; i < len; i++ ) {
2423
if (
2524
isObjectLike( obj ) &&
2625
hasOwnProp( obj, props[ i ] )
2726
) {
2827
obj = obj[ props[ i ] ];
29-
hasOwn = true;
3028
} else {
3129
return false;
3230
}
3331
}
34-
return hasOwn;
32+
return true;
3533
} // end FUNCTION deepHasOwn()
3634

3735

0 commit comments

Comments
 (0)