Skip to content

Commit a779800

Browse files
committed
Rename file and avoid immediately invoked require
1 parent 6a259f3 commit a779800

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

lib/node_modules/@stdlib/assert/is-date-object/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
// MODULES //
3737

38-
var isDateObject = require( './is_date_object.js' );
38+
var isDateObject = require( './main.js' );
3939

4040

4141
// EXPORTS //

lib/node_modules/@stdlib/assert/is-date-object/lib/is_date_object.js renamed to lib/node_modules/@stdlib/assert/is-date-object/lib/main.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@
2020

2121
// MODULES //
2222

23-
var hasToStringTag = require( '@stdlib/utils/detect-tostringtag-support' )();
23+
var hasToStringTag = require( '@stdlib/utils/detect-tostringtag-support' );
2424
var nativeClass = require( '@stdlib/utils/native-class' );
2525
var test = require( './try2getday.js' );
2626

2727

28+
// VARIABLES //
29+
30+
var FLG = hasToStringTag();
31+
32+
2833
// MAIN //
2934

3035
/**
@@ -43,7 +48,7 @@ var test = require( './try2getday.js' );
4348
*/
4449
function isDateObject( value ) {
4550
if ( typeof value === 'object' ) {
46-
if ( hasToStringTag ) {
51+
if ( FLG ) {
4752
return test( value );
4853
}
4954
return ( nativeClass( value ) === '[object Date]' );

lib/node_modules/@stdlib/assert/is-date-object/test/test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ tape( 'if `Symbol.toStringTag` is supported, the function guards against objects
5353
var isDateObject;
5454
var mock;
5555

56-
isDateObject = proxyquire( './../lib/is_date_object.js', {
56+
isDateObject = proxyquire( './../lib/main.js', {
5757
'@stdlib/utils/detect-tostringtag-support': detect
5858
});
5959

@@ -80,7 +80,7 @@ tape( 'if `Symbol.toStringTag` is supported, the function guards against objects
8080
});
8181

8282
tape( 'if `Symbol.toStringTag` is supported, the function returns `true` if provided a `Date` object', opts, function test( t ) {
83-
var isDateObject = proxyquire( './../lib/is_date_object.js', {
83+
var isDateObject = proxyquire( './../lib/main.js', {
8484
'@stdlib/utils/detect-tostringtag-support': detect
8585
});
8686

@@ -94,7 +94,7 @@ tape( 'if `Symbol.toStringTag` is supported, the function returns `true` if prov
9494
});
9595

9696
tape( 'if `Symbol.toStringTag` is not supported, the function attempts to determine the native class', function test( t ) {
97-
var isDateObject = proxyquire( './../lib/is_date_object.js', {
97+
var isDateObject = proxyquire( './../lib/main.js', {
9898
'@stdlib/utils/detect-tostringtag-support': detect
9999
});
100100

@@ -119,7 +119,7 @@ tape( 'the function returns `false` if not provided a `Date` object', function t
119119
NaN,
120120
null,
121121
true,
122-
undefined,
122+
void 0,
123123
[],
124124
{},
125125
/./,

0 commit comments

Comments
 (0)