Skip to content

Commit ac3514a

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 ad586ea commit ac3514a

File tree

1 file changed

+3
-2
lines changed
  • lib/node_modules/@stdlib/plot/sparklines/unicode/lib/props/type

1 file changed

+3
-2
lines changed

lib/node_modules/@stdlib/plot/sparklines/unicode/lib/props/type/set.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@
2121
// MODULES //
2222

2323
var logger = require( 'debug' );
24-
var contains = require( '@stdlib/assert/contains' );
24+
var contains = require( '@stdlib/array/base/assert/contains' ).factory;
2525
var format = require( '@stdlib/string/format' );
2626
var CHART_TYPES = require( './chart_types.json' );
2727

2828

2929
// VARIABLES //
3030

31+
var isChartType = contains( CHART_TYPES );
3132
var debug = logger( 'sparkline:unicode:set:type' );
3233

3334

@@ -42,7 +43,7 @@ var debug = logger( 'sparkline:unicode:set:type' );
4243
*/
4344
function set( type ) {
4445
/* eslint-disable no-invalid-this */
45-
if ( !contains( CHART_TYPES, type ) ) {
46+
if ( !isChartType( type ) ) {
4647
throw new TypeError( format( 'invalid assignment. `%s` must be one of the following: "%s". Value: `%s`.', 'type', CHART_TYPES.join( '", "' ), type ) );
4748
}
4849
if ( type !== this._type ) {

0 commit comments

Comments
 (0)