Skip to content

Commit

Permalink
Fix internal types for TS 4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 17, 2022
1 parent 7c99aef commit c918b68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,21 @@ export function parseEntities(value, options = {}) {
typeof options.additional === 'string'
? options.additional.charCodeAt(0)
: options.additional
/** @type {string[]} */
/** @type {Array<string>} */
const result = []
let index = 0
let lines = -1
let queue = ''
/** @type {Point|undefined} */
let point
/** @type {number[]|undefined} */
/** @type {Array<number>|undefined} */
let indent

if (options.position) {
if ('start' in options.position || 'indent' in options.position) {
// @ts-expect-error: points don’t have indent.
indent = options.position.indent
// @ts-expect-error: points don’t have indent.
point = options.position.start
} else {
point = options.position
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ test('parseEntities(value)', function (t) {
function addFactory(type) {
return add
/**
* @param {unknown[]} things
* @param {Array<unknown>} things
*/
function add(...things) {
// @ts-ignore
Expand Down

0 comments on commit c918b68

Please sign in to comment.