Skip to content

Commit 4a1f629

Browse files
committed
refactor: use base array assertion utility
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent a6dc859 commit 4a1f629

File tree

1 file changed

+3
-2
lines changed
  • lib/node_modules/@stdlib/regexp/basename/lib

1 file changed

+3
-2
lines changed

lib/node_modules/@stdlib/regexp/basename/lib/main.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
// MODULES //
2222

23-
var contains = require( '@stdlib/assert/contains' );
23+
var contains = require( '@stdlib/array/base/assert/contains' ).factory;
2424
var format = require( '@stdlib/string/format' );
2525
var posix = require( '@stdlib/regexp/basename-posix' );
2626
var win32 = require( '@stdlib/regexp/basename-windows' );
@@ -30,6 +30,7 @@ var IS_WINDOWS = require( '@stdlib/assert/is-windows' );
3030
// VARIABLES //
3131

3232
var PLATFORMS = [ 'posix', 'win32' ];
33+
var isPlatform = contains( PLATFORMS );
3334

3435

3536
// MAIN //
@@ -48,7 +49,7 @@ var PLATFORMS = [ 'posix', 'win32' ];
4849
*/
4950
function reBasename( platform ) {
5051
if ( arguments.length > 0 ) {
51-
if ( !contains( PLATFORMS, platform ) ) {
52+
if ( !isPlatform( platform ) ) {
5253
throw new Error( format( 'invalid argument. Must be one of the following: "%s". Value: `%s`.', PLATFORMS.join( '", "' ), platform ) );
5354
}
5455
}

0 commit comments

Comments
 (0)