Skip to content

Commit 1c767e4

Browse files
committed
Update example code
1 parent 1b86ffe commit 1c767e4

16 files changed

Lines changed: 48 additions & 115 deletions

File tree

lib/node_modules/@stdlib/fs/close/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,10 @@ var openSync = require( '@stdlib/fs/open' ).sync;
9696
var close = require( '@stdlib/fs/close' );
9797

9898
var err;
99-
var fd;
10099

101100
/* Sync */
102101

103-
fd = openSync( join( __dirname, 'package.json' ), 'r+' );
102+
var fd = openSync( join( __dirname, 'package.json' ), 'r+' );
104103
if ( fd instanceof Error ) {
105104
console.error( fd.message );
106105
} else {

lib/node_modules/@stdlib/fs/close/examples/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ var openSync = require( '@stdlib/fs/open' ).sync;
2222
var close = require( './../lib' ); // eslint-disable-line stdlib/no-redeclare
2323

2424
var err;
25-
var fd;
2625

2726
/* Sync */
2827

29-
fd = openSync( __filename, 'r+' );
28+
var fd = openSync( __filename, 'r+' );
3029
// returns <number>
3130

3231
if ( fd instanceof Error ) {

lib/node_modules/@stdlib/process/umask/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,18 +197,15 @@ mask = umask( 0, opts );
197197
var lpad = require( '@stdlib/string/left-pad' );
198198
var umask = require( '@stdlib/process/umask' );
199199
200-
var mask;
201-
var opts;
202-
203200
// Print the process mask as an integer:
204-
mask = umask();
201+
var mask = umask();
205202
console.log( mask.toString() );
206203
207204
// Print the process mask as an octal string:
208205
console.log( lpad( mask.toString(), 4, '0' ) );
209206
210207
// Print the process mask using symbolic notation:
211-
opts = {
208+
var opts = {
212209
'symbolic': true
213210
};
214211
console.log( umask( opts ) );

lib/node_modules/@stdlib/process/umask/examples/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,15 @@
2121
var lpad = require( '@stdlib/string/left-pad' );
2222
var umask = require( './../lib' );
2323

24-
var mask;
25-
var opts;
26-
2724
// Print the process mask as an integer:
28-
mask = umask();
25+
var mask = umask();
2926
console.log( mask.toString() );
3027

3128
// Print the process mask as an octal string:
3229
console.log( lpad( mask.toString(), 4, '0' ) );
3330

3431
// Print the process mask using symbolic notation:
35-
opts = {
32+
var opts = {
3633
'symbolic': true
3734
};
3835
console.log( umask( opts ) );

lib/node_modules/@stdlib/random/sample/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,9 @@ out = mysample();
233233
```javascript
234234
var sample = require( '@stdlib/random/sample' );
235235

236-
var out;
237-
var x;
238-
239236
// By default, sample uniformly with replacement:
240-
x = [ 'a', 'b', 'c', 'd' ];
241-
out = sample( x, {
237+
var x = [ 'a', 'b', 'c', 'd' ];
238+
var out = sample( x, {
242239
'size': 10
243240
});
244241
// e.g., returns [ 'd', 'c', 'b', 'b', 'b', 'd', 'c', 'c', 'b', 'd' ]

lib/node_modules/@stdlib/random/sample/examples/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@
2020

2121
var sample = require( './../lib' );
2222

23-
var out;
24-
var x;
25-
2623
// By default, sample uniformly with replacement:
27-
x = [ 'a', 'b', 'c', 'd' ];
28-
out = sample( x, {
24+
var x = [ 'a', 'b', 'c', 'd' ];
25+
var out = sample( x, {
2926
'size': 10
3027
});
3128
console.log( 'By default, sample uniformly with replacement:\n%s', out.toString() );

lib/node_modules/@stdlib/utils/enumerable-properties-in/README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,7 @@ var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' );
6464
var Symbol = require( '@stdlib/symbol/ctor' );
6565
var enumerablePropertiesIn = require( '@stdlib/utils/enumerable-properties-in' );
6666

67-
var hasSymbols;
68-
var props;
69-
var obj;
70-
71-
hasSymbols = hasSymbolSupport();
67+
var hasSymbols = hasSymbolSupport();
7268

7369
function Foo() {
7470
this.a = 'b';
@@ -83,11 +79,9 @@ if ( hasSymbols ) {
8379
Foo.prototype[ Symbol( 'foo' ) ] = 'bar';
8480
}
8581

86-
obj = new Foo();
87-
props = enumerablePropertiesIn( obj );
88-
89-
console.log( props );
90-
// e.g., => [ 'a', 'foo', ... ]
82+
var obj = new Foo();
83+
var props = enumerablePropertiesIn( obj );
84+
// e.g., returns [ 'a', 'foo', ... ]
9185
```
9286

9387
</section>

lib/node_modules/@stdlib/utils/enumerable-properties-in/examples/index.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' );
2222
var Symbol = require( '@stdlib/symbol/ctor' );
2323
var enumerablePropertiesIn = require( './../lib' );
2424

25-
var hasSymbols;
26-
var props;
27-
var obj;
28-
29-
hasSymbols = hasSymbolSupport();
25+
var hasSymbols = hasSymbolSupport();
3026

3127
function Foo() {
3228
this.a = 'b';
@@ -41,8 +37,7 @@ if ( hasSymbols ) {
4137
Foo.prototype[ Symbol( 'foo' ) ] = 'bar';
4238
}
4339

44-
obj = new Foo();
45-
props = enumerablePropertiesIn( obj );
46-
40+
var obj = new Foo();
41+
var props = enumerablePropertiesIn( obj );
4742
console.log( props );
48-
// => [ 'a', 'foo', ... ]
43+
// e.g., => [ 'a', 'foo', ... ]

lib/node_modules/@stdlib/utils/inherited-properties/README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ var Symbol = require( '@stdlib/symbol/ctor' );
6767
var defineProperty = require( '@stdlib/utils/define-property' );
6868
var inheritedProperties = require( '@stdlib/utils/inherited-properties' );
6969

70-
var hasSymbols;
71-
var props;
72-
var obj;
73-
74-
hasSymbols = hasSymbolSupport();
70+
var hasSymbols = hasSymbolSupport();
7571

7672
function Foo() {
7773
this.a = 'b';
@@ -110,11 +106,9 @@ if ( hasSymbols ) {
110106
});
111107
}
112108

113-
obj = new Foo();
114-
props = inheritedProperties( obj );
115-
116-
console.log( props );
117-
// => [ ..., 'c', 'bip', ... ]
109+
var obj = new Foo();
110+
var props = inheritedProperties( obj );
111+
// returns [ ..., 'c', 'bip', ... ]
118112
```
119113

120114
</section>

lib/node_modules/@stdlib/utils/inherited-properties/examples/index.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ var Symbol = require( '@stdlib/symbol/ctor' );
2323
var defineProperty = require( '@stdlib/utils/define-property' );
2424
var inheritedProperties = require( './../lib' );
2525

26-
var hasSymbols;
27-
var props;
28-
var obj;
29-
30-
hasSymbols = hasSymbolSupport();
26+
var hasSymbols = hasSymbolSupport();
3127

3228
function Foo() {
3329
this.a = 'b';
@@ -66,8 +62,7 @@ if ( hasSymbols ) {
6662
});
6763
}
6864

69-
obj = new Foo();
70-
props = inheritedProperties( obj );
71-
65+
var obj = new Foo();
66+
var props = inheritedProperties( obj );
7267
console.log( props );
73-
// => [ 'c', 'bip', ... ]
68+
// => [ ..., 'c', 'bip', ... ]

0 commit comments

Comments
 (0)