Skip to content

Commit 84eb74c

Browse files
committed
Fix lint errors
1 parent 8cdfc20 commit 84eb74c

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

lib/node_modules/@stdlib/utils/copy/README.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,45 +16,47 @@ var copy = require( '@stdlib/utils/copy' );
1616
Copy or deep clone an input `value` to an arbitrary depth. The function accepts both `objects` and `primitives`.
1717

1818
``` javascript
19-
var value;
20-
var bool;
21-
var err1;
22-
var err2;
23-
var out;
24-
2519
// Primitives...
26-
out = copy( 'beep' );
20+
var out = copy( 'beep' );
2721
// returns 'beep'
2822

2923
// Objects...
30-
value = [{'a':1,'b':true,'c':[1,2,3]}];
24+
var value = [
25+
{
26+
'a': 1,
27+
'b': true,
28+
'c': [ 1, 2, 3 ]
29+
}
30+
];
3131
out = copy( value );
32-
// returns [{'a':1,'b':true,'c':[1,2,3]}]
32+
// returns [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]
3333

34-
bool = ( value[0].c === out[0].c );
34+
var bool = ( value[0].c === out[0].c );
3535
// returns false
3636

3737
// Error object...
38-
err1 = new TypeError( 'beep' );
38+
var err1 = new TypeError( 'beep' );
3939

40-
err2 = copy( err1 );
40+
var err2 = copy( err1 );
4141
// returns <TypeError>
4242
```
4343

4444
The default behavior returns a __full__ deep copy of any `object`. To limit the copy depth, set the `level` option.
4545

4646
``` javascript
47-
var value;
48-
var bool;
49-
var out;
50-
51-
value = [{'a':1,'b':true,'c':[1,2,3]}];
47+
var value = [
48+
{
49+
'a': 1,
50+
'b': true,
51+
'c': [ 1, 2, 3 ]
52+
}
53+
];
5254

5355
// Trivial case => return the same reference
54-
out = copy( value, 0 );
55-
// returns [{'a':1,'b':true,'c':[1,2,3]}]
56+
var out = copy( value, 0 );
57+
// returns [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]
5658

57-
bool = ( value[0] === out[0] );
59+
var bool = ( value[0] === out[0] );
5860
// returns true
5961

6062
// Shallow copy:
@@ -142,6 +144,8 @@ bool = ( value[0].c === out[0].c );
142144

143145
* Support for copying class instances is inherently __fragile__. Any instances with privileged access to variables (e.g., within closures) cannot be cloned. This stated, basic copying of class instances is supported. Provided an environment which supports ES5, the implementation is greedy and performs a deep clone of any arbitrary class instance and its properties. The implementation assumes that the concept of `level` applies only to the class instance reference, but not to its internal state.
144146

147+
<!-- eslint-disable no-underscore-dangle -->
148+
145149
``` javascript
146150
function Foo() {
147151
this._data = [ 1, 2, 3, 4 ];

0 commit comments

Comments
 (0)