Skip to content

Commit

Permalink
Refactor code-style
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Apr 16, 2024
1 parent 4b47a43 commit fc29385
Show file tree
Hide file tree
Showing 4 changed files with 249 additions and 242 deletions.
12 changes: 3 additions & 9 deletions packages/micromark-util-subtokenize/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@
* @typedef {import('micromark-util-types').Token} Token
*/

/**
* @template {{} | null} T
* @typedef {import('micromark-util-types').SpliceBuffer<T>} SpliceBuffer<T>
*/

import {splice} from 'micromark-util-chunked'
import {codes, types} from 'micromark-util-symbol'
import {ok as assert} from 'devlop'
import {spliceBuffer} from './splice-buffer.js'
import {SpliceBuffer} from './splice-buffer.js'

/**
* Tokenize subcontent.
Expand Down Expand Up @@ -41,8 +36,7 @@ export function subtokenize(eventsArray) {
let subevents
/** @type {boolean | undefined} */
let more
/** @type {SpliceBuffer<Event>} */
const events = spliceBuffer(eventsArray)
const events = new SpliceBuffer(eventsArray)

while (++index < events.length) {
while (index in jumps) {
Expand Down Expand Up @@ -139,7 +133,7 @@ export function subtokenize(eventsArray) {
/**
* Tokenize embedded tokens.
*
* @param {SpliceBuffer<Event>} events
* @param {import('./splice-buffer.js').SpliceBuffer<Event>} events
* @param {number} eventIndex
* @returns {Record<string, number>}
*/
Expand Down

0 comments on commit fc29385

Please sign in to comment.