Skip to content

Commit f99ec78

Browse files
committed
refactor: add missing assertion
--- 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 fa8250e commit f99ec78

File tree

1 file changed

+3
-0
lines changed
  • lib/node_modules/@stdlib/ndarray/count-if/lib

1 file changed

+3
-0
lines changed

lib/node_modules/@stdlib/ndarray/count-if/lib/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ function countIf( x, options, predicate, thisArg ) {
113113
// Case: countIf( x, predicate )
114114
if ( nargs < 3 ) {
115115
cb = options;
116+
if ( !isFunction( cb ) ) {
117+
throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', cb ) );
118+
}
116119
}
117120
// Case: countIf( x, options, predicate, thisArg )
118121
else if ( nargs > 3 ) {

0 commit comments

Comments
 (0)