Skip to content

Commit a52b36e

Browse files
committed
refactor(remark): align splice idiom with sibling plugins
Alias `parent.children` as `c` immediately before the `splice.apply` call and invoke through `c.splice.apply( c, ... )`. Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> --- 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 2f17312 commit a52b36e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • lib/node_modules/@stdlib/_tools/remark/plugins/remark-includes/lib

lib/node_modules/@stdlib/_tools/remark/plugins/remark-includes/lib/transformer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ function factory( opts ) {
7878
var match;
7979
var base;
8080
var end;
81+
var c;
8182
var i;
8283

8384
match = INCLUDE_START.exec( node.value );
@@ -137,7 +138,8 @@ function factory( opts ) {
137138
parent.children.splice( index + 1, end - index - 1 );
138139

139140
// Insert the parsed nodes between the opening and closing tags:
140-
Array.prototype.splice.apply( parent.children, [ index + 1, 0 ].concat( children ) ); // eslint-disable-line max-len
141+
c = parent.children;
142+
c.splice.apply( c, [ index + 1, 0 ].concat( children ) );
141143
debug( 'Inserted include content.' );
142144
}
143145
}

0 commit comments

Comments
 (0)