File tree Expand file tree Collapse file tree 14 files changed +17
-12
lines changed
_tools/eslint/rules/require-file-extensions/lib
datasets/moby-dick/scripts Expand file tree Collapse file tree 14 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,10 @@ function main( context ) {
118
118
parts = path . parse ( requirePath ) ;
119
119
120
120
// If the path cannot be resolved, we report an error with the exception of Node.js native add-ons as they may not have been built yet:
121
- if ( resolved instanceof Error && parts . ext !== '.node' ) {
121
+ if ( resolved instanceof Error ) {
122
+ if ( parts . ext === '.node' ) {
123
+ return ;
124
+ }
122
125
return report ( node , 'cannot resolve module: "' + requirePath + '"' ) ;
123
126
}
124
127
resolved = path . parse ( resolved ) ;
Original file line number Diff line number Diff line change 21
21
// MODULES //
22
22
23
23
var isFunction = require ( '@stdlib/assert/is-function' ) ;
24
+ var Object = require ( '@stdlib/object/ctor' ) ;
24
25
25
26
26
27
// MAIN //
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ var bool = ( FLOAT32_PINF === Infinity );
54
54
var FLOAT32_PINF = require ( ' @stdlib/constants/float32/pinf' );
55
55
56
56
console .log ( FLOAT32_PINF );
57
- // => + Infinity
57
+ // => Infinity
58
58
```
59
59
60
60
</section >
Original file line number Diff line number Diff line change 21
21
var FLOAT32_PINF = require ( './../lib' ) ;
22
22
23
23
console . log ( FLOAT32_PINF ) ;
24
- // => +infinity
24
+ // => Infinity
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ var RE_FIRST_TWO_LINES = /^.*\n\n/;
43
43
* Main execution sequence.
44
44
*
45
45
* @private
46
+ * @throws {Error } unexpected file content
46
47
*/
47
48
function main ( ) {
48
49
var fpath ;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ var reDirnamePosix = require( './../lib/main.js' );
28
28
29
29
tape ( 'main export is a function' , function test ( t ) {
30
30
t . ok ( true , __filename ) ;
31
- t . equal ( reDirnamePosix instanceof Function , true , 'main export is a function' ) ;
31
+ t . equal ( typeof reDirnamePosix , 'function' , 'main export is a function' ) ;
32
32
t . end ( ) ;
33
33
} ) ;
34
34
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ var reDirnameWindows = require( './../lib/main.js' );
28
28
29
29
tape ( 'main export is a function' , function test ( t ) {
30
30
t . ok ( true , __filename ) ;
31
- t . equal ( reDirnameWindows instanceof Function , true , 'main export is a function' ) ;
31
+ t . equal ( typeof reDirnameWindows , 'function' , 'main export is a function' ) ;
32
32
t . end ( ) ;
33
33
} ) ;
34
34
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ proxyquire = proxyquire.noPreserveCache();
34
34
35
35
tape ( 'main export is a function' , function test ( t ) {
36
36
t . ok ( true , __filename ) ;
37
- t . equal ( reDirname instanceof Function , true , 'main export is a function' ) ;
37
+ t . equal ( typeof reDirname , 'function' , 'main export is a function' ) ;
38
38
t . end ( ) ;
39
39
} ) ;
40
40
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ var reExtnamePosix = require( './../lib/main.js' );
28
28
29
29
tape ( 'main export is a function' , function test ( t ) {
30
30
t . ok ( true , __filename ) ;
31
- t . equal ( reExtnamePosix instanceof Function , true , 'main export is a function' ) ;
31
+ t . equal ( typeof reExtnamePosix , 'function' , 'main export is a function' ) ;
32
32
t . end ( ) ;
33
33
} ) ;
34
34
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ var reExtnameWindows = require( './../lib/main.js' );
28
28
29
29
tape ( 'main export is a function' , function test ( t ) {
30
30
t . ok ( true , __filename ) ;
31
- t . equal ( reExtnameWindows instanceof Function , true , 'main export is a function' ) ;
31
+ t . equal ( typeof reExtnameWindows , 'function' , 'main export is a function' ) ;
32
32
t . end ( ) ;
33
33
} ) ;
34
34
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ proxyquire = proxyquire.noPreserveCache();
34
34
35
35
tape ( 'main export is a function' , function test ( t ) {
36
36
t . ok ( true , __filename ) ;
37
- t . equal ( reExtname instanceof Function , true , 'main export is a function' ) ;
37
+ t . equal ( typeof reExtname , 'function' , 'main export is a function' ) ;
38
38
t . end ( ) ;
39
39
} ) ;
40
40
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ var reFunctionName = require( './../lib/main.js' );
30
30
31
31
tape ( 'main export is a function' , function test ( t ) {
32
32
t . ok ( true , __filename ) ;
33
- t . equal ( reFunctionName instanceof Function , true , 'main export is a function' ) ;
33
+ t . equal ( typeof reFunctionName , 'function' , 'main export is a function' ) ;
34
34
t . end ( ) ;
35
35
} ) ;
36
36
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ var reRegExp = require( './../lib/main.js' );
28
28
29
29
tape ( 'main export is a function' , function test ( t ) {
30
30
t . ok ( true , __filename ) ;
31
- t . equal ( reRegExp instanceof Function , true , 'main export is a function' ) ;
31
+ t . equal ( typeof reRegExp , 'function' , 'main export is a function' ) ;
32
32
t . end ( ) ;
33
33
} ) ;
34
34
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ var reUncPath = require( './../lib/main.js' );
28
28
29
29
tape ( 'main export is a function' , function test ( t ) {
30
30
t . ok ( true , __filename ) ;
31
- t . equal ( reUncPath instanceof Function , true , 'main export is a function' ) ;
31
+ t . equal ( typeof reUncPath , 'function' , 'main export is a function' ) ;
32
32
t . end ( ) ;
33
33
} ) ;
34
34
You can’t perform that action at this time.
0 commit comments