Skip to content

Commit

Permalink
docs(core): add TSDoc for isExecutableToken
Browse files Browse the repository at this point in the history
  • Loading branch information
freshgum-bubbles committed May 30, 2024
1 parent c581309 commit f33b398
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/executable-token.class.mts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ export abstract class ExecutableToken<T> extends Token<T> {
readonly [EXECUTABLE_TOKEN] = ExecutableTokenStamp.Generic;
}

/**
* Determine whether a given value is of type {@link ExecutableToken}.
*
* @param x - The parameter to test.
* @returns Whether the given value is an executable token.
*/
export function isExecutableToken(x: any): x is ExecutableToken<unknown> {
return x != null && x[EXECUTABLE_TOKEN] == ExecutableTokenStamp.Generic;
}

0 comments on commit f33b398

Please sign in to comment.