Skip to content

Commit

Permalink
fix: include inline documentation for Parser
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Jul 24, 2024
1 parent a790518 commit f048aaf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/sassdoc-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ import sorter from "./sorter.js";
import type { ParseResult } from "./types.js";
import { removeReduntantWhitespace } from "./utils.js";

/**
* If you're running {@link parse} or {@link parseSync} on a hot code path,
* you might discover a noticable time is spent constructing this Parser class
* since they create a new instance of this parser for each invocation.
*
* For performance sensitive applications you may want to import this class and
* reuse the parser instance.
*
* @example
* const parser = new Parser();
* const result = parser.parseStringSync(`
* /// Keep it secret
* $_secret: 'keep-it-safe';
* `);
*/
export class Parser {
annotations: AnnotationsApi;
commentParser: SassCommentParser;
Expand Down

0 comments on commit f048aaf

Please sign in to comment.