Skip to content

Commit

Permalink
Fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Nov 22, 2024
1 parent f938e5d commit 213f3f9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
// Type Definitions
//-----------------------------------------------------------------------------

/** @typedef {import("css-tree").SyntaxReferenceError} SyntaxReferenceError */
/** @typedef {import("css-tree").SyntaxMatchError} SyntaxMatchError */
/*
* Note: Using `import()` in the JSDoc comments below because including them as
* typedef comments here caused Rollup to remove them. I couldn't figure out why
* this was happening so just working around for now.
*/

//-----------------------------------------------------------------------------
// Helpers
Expand All @@ -17,7 +20,7 @@
/**
* Determines if an error is a reference error.
* @param {Object} error The error object to check.
* @returns {error is SyntaxReferenceError} True if the error is a reference error, false if not.
* @returns {error is import("css-tree").SyntaxReferenceError} True if the error is a reference error, false if not.
*/
export function isSyntaxReferenceError(error) {
return typeof error.reference === "string";
Expand All @@ -26,7 +29,7 @@ export function isSyntaxReferenceError(error) {
/**
* Determines if an error is a syntax match error.
* @param {Object} error The error object to check.
* @returns {error is SyntaxMatchError} True if the error is a syntax match error, false if not.
* @returns {error is import("css-tree").SyntaxMatchError} True if the error is a syntax match error, false if not.
*/
export function isSyntaxMatchError(error) {
return typeof error.syntax === "string";
Expand Down

0 comments on commit 213f3f9

Please sign in to comment.